I use PUGXMulti USer , it is An extension for FOSUserBundle to handle users of different types. Following the documentation STep by Step , I created my Entity USER , and 2 other Entities ( Driver , Client ) extends User
/**@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;
Client entity start with :
* @ORM\Entity
* @ORM\Table(name="client")
*/
class Client extends User
{
/**
* @var string
*/
private $fnameClient;
I created a FormType for ClientRegistration ,
class ClientFormType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('fnameClient');
$builder->add('username');
$builder->add('email');
The problem is when I submit the form , it gave me the error:
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"]:
My remarks is why he is trying to do where t0.username_canonical
istead of t1.username_canonical