PUGXMulti-user-Bundle:实体类不存在

时间:2014-09-08 22:26:47

标签: php symfony sylius pugxmultiuserbundle

我试图在Sylius安装中实现PUGXMultiUserBundle。

按照捆绑包的说明后,我可以填写注册用户的表格,但我得到的只是:

'Entity class 'UserOne' used in the discriminator map of class 'UserBundle\Entity\User' does not exist.

正如捆绑文档中所述,我的User.php:

namespace UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM; 
use FOS\UserBundle\Model\User as BaseUser;

/**
 * @ORM\Entity
 * @ORM\Table(name="sylius_user")  
 * @ORM\InheritanceType("JOINED")  
 * @ORM\DiscriminatorColumn(name="type", type="string")  
 * @ORM\DiscriminatorMap({"userOne" = "UserOne", "userTwo" = "UserTwo"}) 
 */
abstract class User extends BaseUser {

/**
 * @ORM\Id
 * @ORM\Column(type="integer")
 * @ORM\GeneratedValue(strategy="AUTO")
 */
protected $id; 
}

我的userOne.php类:

namespace UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM; 
use PUGX\MultiUserBundle\Validator\Constraints\UniqueEntity;

/**  
 * @ORM\Entity  
 * @ORM\Table(name="userOne")  
 * @UniqueEntity(fields = "username", targetClass ="UserBundle\Entity\User", message="fos_user.username.already_used")  
 * @UniqueEntity(fields = "email", targetClass ="UserBundle\Entity\User", message="fos_user.email.already_used")
 */

class UserOne extends User {

/**
 * @ORM\Id
 * @ORM\Column(type="integer")
 * @ORM\GeneratedValue(strategy="AUTO")
 */
protected $id; 
}

我将不胜感激任何反馈。由于相同的错误,我无法生成实体和/或完成注册。

任何帮助都会非常感激。

0 个答案:

没有答案