我正在使用FOSUserBundle和Symfony2。我试图使用注册电子邮件确认功能。当我点击/ confirmation / {confirmationToken} url时,Doctrine会引发以下异常
Notice: Undefined index: 000000006553367d000000005133f603 in /Users/jacobspizziri/Documents/Projects/SRC3/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 2873
当它尝试散列我在此构造的Group实体时会发生这种情况:
spl_object_hash($entity)
和$ entity看起来像这样:
以下是我在实体中设置的关系:
/**
* @ORM\Entity
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*
* @author jacobspizziri
*/
class Group implements SoftDeletableInterface, TimestampableInterface {
/**
* @ORM\OneToMany(targetEntity="SRC\Bundle\UserBundle\Entity\User", mappedBy="group", cascade={"all"})
*/
protected $users;
}
/**
* @ORM\Entity
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*/
class User extends BaseUser implements SoftDeletableInterface, TimestampableInterface
{
/**
* @ORM\ManyToOne(targetEntity="SRC\Bundle\UserBundle\Entity\Group", inversedBy="users")
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
*/
protected $group;
}
我的捆绑包扩展了FOSUserBundle但是我没有为我的群组扩展FOSUserBundle \ Entity \ Group
这是怎么回事?