Symfony 我无法使fos用户表更新新字段
好吧,我是新来的 我们已经浏览了很长时间了 我做错了什么,我看不出来 我用的是symony 2.8.什么的 我已经安装了Fos用户包(很棒的作品) 完成了一些配置Symfony 我无法使fos用户表更新新字段,symfony,fosuserbundle,Symfony,Fosuserbundle,好吧,我是新来的 我们已经浏览了很长时间了 我做错了什么,我看不出来 我用的是symony 2.8.什么的 我已经安装了Fos用户包(很棒的作品) 完成了一些配置 app/config/config.yml fos_user: db_driver: orm firewall_name: main user_class: Prox\AdminBundle\Entity\User 我的用户实体 namespace Prox\AdminBundle\Entity; use
app/config/config.yml
fos_user:
db_driver: orm
firewall_name: main
user_class: Prox\AdminBundle\Entity\User
我的用户实体
namespace Prox\AdminBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
* @ORM\Table(name="fos_user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(type="string", length=100,nullable=true)
*/
private $firstname;
/**
* @var string
*
* @ORM\Column(type="string", length=100,nullable=true)
*/
private $lastname;
/**
* @var string
*
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $profilepic;
public function __construct()
{
parent::__construct();
// your own logic
}
/**
* Get firstname
* @return string
*/
public function getFirstname()
{
return $this->firstname;
}
/**
* Set firstname
* @param string $firstname
* @return User
*/
public function setFirstname($firstname)
{
$this->firstname = $firstname;
return $this;
}
/**
* Get lastname
* @return string
*/
public function getLastname()
{
return $this->lastname;
}
/**
* Set lastname
* @param string $lastname
* @return User
*/
public function setLastname($lastname)
{
$this->lastname = $lastname;
return $this;
}
/**Get profilepic
* @return string
*/
public function getProfilepic()
{
return $this->firstname;
}
/**
* @param string $profilepic
* @return User
*/
public function setProfilepic($profilepic)
{
$this->profilepic = $profilepic;
return $this;
}
我的应用程序Prox/AdminBundle/Resources/config/doctor
Prox\AdminBundle\Entity\User:
type: entity
table: fos_user
id:
id:
type: integer
generator:
strategy: AUTO
fields:
firstname:
type: string
length: 100
lastname:
type: string
length: 100
profilepic:
type: string
length: 255
这是给定的代码,也是添加到应用程序内核的代码
当我运行schema:update--force时
它表示数据库已经同步。日志确认未拾取我的批注
简言之,我忘记了什么,我的谷歌宝贝给了我很多提示,但没有一个有效,我没有看到它。我还要检查什么呢可能与映射有关;您使用的是Yaml(实际上也是注释?一开始只能使用其中一个),但FOS UserBundle使用XML映射用户实体/表。文档中指出,我认为它只能使用一种映射格式。注释相关错误可能来自route,而不是fos。你能举一个你看到的错误的例子吗?试着为prod&dev清除缓存。我过去经常遇到这种情况,有时我认为这是缓存问题,但我不确定这是symfony的。