title: Entity forms problems with Symfony2 relation many to many
body: <p>I’m actually learning Symfony2 and I have a problem. I have a relation many to many between a movie and an actor.</p>
  
  <p>I have created a form to create a new movie. In this form I have a selected input to choose actors but when I select many actors the form generated an error “This value should not be blank”. When I delete my assert in actor class I haven’t this error.
  Why my form check the assert in my actor class?</p>
  
  <pre><code>    /*
         *  MOVIE CLASS
         *
         */    
      class Movie
          {
              //...
  
  
              /**
               * @ORM\ManyToMany(targetEntity="Actor", inversedBy="movies")
               * @ORM\JoinTable(name="movie_actor")
               */
              protected $actors;
          }
  
         /*
         *  ACTOR CLASS
         *
         */
  
          class Actor
          {
  
              /**
               * @ORM\Column(type="string", length="255")
               * @Assert\NotBlank()
               * @Assert\MinLength(3)
               */
              protected $firstName;
  
              /**
               * @ORM\Column(type="string", length="255")
               * @Assert\NotBlank()
               * @Assert\MinLength(3)
               */
              protected $lastName;
  
              /**
               * @ORM\Column(type="date", nullable = true)
               */
              protected $birthday;
  
              /**
               * @ORM\Column(type="boolean")
               * @Assert\NotBlank()
               */
              protected $sexe;
  
  
              /**
               * @ORM\ManyToMany(targetEntity="Movie", mappedBy="actors")
               * @Assert\NotNull()
               */
              protected $movies;
          }
  
  
  /**
  *
  * MOVIE FORM 
  */
  class MovieType extends AbstractType
  {
      public function buildForm(FormBuilder $builder, array $options)
      {
          $builder
              -&gt;add('title')
              -&gt;add('description')
              -&gt;add('category')
              -&gt;add('actors', 'entity',  
              array(
                  'class' =&gt; 'MyAppFilmothequeBundle:Actor',
                  'query_builder' =&gt; function(EntityRepository $er)
                      {
                          return $er-&gt;createQueryBuilder('a')-&gt;orderBy('a.firstName', 'ASC');
                      },
                   'multiple' =&gt; true
              ))
              -&gt;add('user')
          ;
      }
  
      public function getDefaultOptions(array $options)
      {
          return array(
          'data_class' =&gt; 'MyApp\FilmothequeBundle\Entity\Movie');
      }
      public function getName()
      {
          return 'movie';
      }
  }
  </code></pre>