我使用PUGXMulti USer,它是FOSUserBundle的扩展,用于处理不同类型的用户。 按照STep by Step文档,我创建了我的实体用户,另外两个实体(驱动程序,客户端)扩展了用户
/**@ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({"user_one" = "Dali/FrontBundle/Driver", "user_two" = "Dali/FrontBundle/Client"})
*
*/
abstract class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id_user;
客户实体以:
开头* @ORM\Entity
* @ORM\Table(name="client")
*/
class Client extends User
{
/**
* @var string
*/
private $fnameClient;
我为ClientRegistration创建了一个FormType,
class ClientFormType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('fnameClient');
$builder->add('username');
$builder->add('email');
问题是当我提交表单时,它给了我错误:
An exception occurred while executing 'SELECT t1.username AS username2, t1.username_canonical AS username_canonical3, .... FROM client t1 WHERE t0.username_canonical = ?' with params ["az"]:
我的评论是他试图where t0.username_canonical
而不是t1.username_canonical