我需要使用Symfony2中的ServiceBundle来创建登录功能。问题是:有没有办法使用具有唯一字段uid的实体“配置文件”,如果它连接到OneToOne关系上的“学生”实体?
到目前为止,我刚收到错误:
“ContextErrorException:Catchable Fatal Error:类Proxies__CG __ \ Acme \ StudentsManagerBundle \ Entity \ Student的对象无法转换为C:\ xampp \ htdocs \ symfony.localhost \ Symfony \ vendor \ symfony \ symfony \ src \中的字符串Symfony \ Component \ Security \ Http \ Firewall \ AbstractAuthenticationListener.php第215行“
这是Doctrine代码
...
/**
* @ORM\OneToOne(targetEntity="Acme\StudentsManagerBundle\Entity\Student")
* @ORM\JoinColumn(name="cnp", referencedColumnName="cnp")
* @ORM\OneToOne(targetEntity="ActivareCont", mappedBy="cnp")
* @ORM\Id
*/
private $cnp;
...
由于