Why am I getting an error with this form choice set to multiple. This is coming directly off of Symfonys website. All I changed was the variable name.
$builder->add('genre', 'choice', array(
'choices' => array(
'x' => 'x',
'y' => 'y',
'z' => 'z',
),
'multiple' => true,
));
This is the error:
Unable to transform value for property path "genre": Expected an array.
Here is my entity class for this variable:
/**
* @var string
*
* @ORM\Column(name="genre", type="text", nullable=true)
*/
private $genre;
arrayof results but your "genre" property is only astring. You will either need to change the mapping for genre to anarrayor remove the'multiple' => true.