title: FOSUserBundle discriminator mapping registration
body: <p>I have a class <strong>User</strong> and two children-classes <strong>Prestataire</strong> and <strong>Membre</strong>.
  I've made a mapping discrimination.</p>
  
  <p>Class User.php</p>
  
  <pre><code>namespace Annuaire\AnnuaireBundle\Entity;
  
  use FOS\UserBundle\Model\User as BaseUser;
  use DateTime;
  use Doctrine\Common\Collections\ArrayCollection;
  use \Doctrine\ORM\Mapping as ORM;
  
  
  
  /**
   * @ORM\Table()
   * @ORM\Entity(repositoryClass="UserRepository")
   * @ORM\InheritanceType("SINGLE_TABLE")
   * @ORM\DiscriminatorColumn(name="type_user", type="string")
   * @ORM\DiscriminatorMap({"admin" = "User", "membre" = "Membre", "prestataire" = "Prestataire"})
   */
  class User extends BaseUser
  {
      const Type_USER = 'admin';
      const Type_PRESTATAIRE = 'prestataire';
      const Type_MEMBRE = 'membre';
  
  
      public function __construct() {
          parent::__construct();
          $this-&gt;typeUser = User::Type_USER;
          $this-&gt;dateInscr = new DateTime();
          $this-&gt;confInscr = false;  
          $this-&gt;banni = false;
          $this-&gt;nmbEssais = null;  
          $this-&gt;images = new ArrayCollection();
      }
  
  ....
  
      function getTypeuser() {
          return $this-&gt;typeUser;
      }
  
      function setTypeuser($typeUser) {
          $this-&gt;typeUser = $typeUser;
      }
  </code></pre>
  
  <p>Class Prestataire.php</p>
  
  <pre><code>namespace Annuaire\AnnuaireBundle\Entity;
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * @ORM\Entity(repositoryClass="Annuaire\AnnuaireBundle\Entity\PrestataireReposito     ry")
   */
  class Prestataire extends User
  {
      public function __construct() {
          $this-&gt;typeUser = User::Type_PRESTATAIRE;    
          $this-&gt;stages = new ArrayCollection();  
          $this-&gt;promos = new ArrayCollection();  
          $this-&gt;categories = new ArrayCollection();
          $this-&gt;favorites = new ArrayCollection();
          parent::__construct();
      }
  </code></pre>
  
  <p>Class Membre.php</p>
  
  <pre><code>namespace Annuaire\AnnuaireBundle\Entity;
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * @ORM\Entity
   */
  class Membre extends User
  {
  
      public function __construct() {
          $this-&gt;typeUser = User::Type_MEMBRE;       
  
          $this-&gt;notes = new ArrayCollection();    
          $this-&gt;favorites = new ArrayCollection();    
          parent::__construct();
      }
  </code></pre>
  
  <p>When user would log-on he choose one of two user's types. So the parameter of type is sended by URL <em>register/prestataire</em> or <em>register/membre</em>.
  And I don't know how I can set a Type in the DataBase by FOSUserBundle.</p>