title: SYMFONY FORM ChoiceType, multiple=>true. How to by pass the need to implement Data Transformers
body: <p>In a SYMFONY FORM (ORM is not use (PDO is used for DB query instead)).</p>
  
  <p>I have a class MyEntityType in which the buildForm function has:</p>
  
  <pre><code>$builder-&gt;add('my_attribute',ChoiceType::class,array(
    'choices'=&gt;$listForMyAttribute,
    'multiple'=&gt;'true',
    'attr'=&gt;array('data-native-menu'=&gt;'false'),
    'label'=&gt;'Multiple Select on my attribute'
  ));
  </code></pre>
  
  <p>My attribute is an array of an entity named MyEntity which has:</p>
  
  <pre><code>/**
  * @Assert\NotBlank()
  */
  private $myAttribute;
  </code></pre>
  
  <p>With a getter and a setter for that variable $myAttribute.</p>
  
  <p>When I submit the form in the Controller, it doesn't pass the validation check and logs this error:</p>
  
  <p><strong>Unable to reverse value for property path "myAttribute" : Could not find all matching choices for the given values.</strong></p>
  
  <p>When I start to look  for solution around this error message, it leads to something named "How to Use Data Transformers" in SYMFONY Cookbook; And it seems a solution would involve to create new Class and write a lot of code for something that one should be able to by-pass in a much straight forward way.</p>
  
  <p>Does anyone have an idea?</p>