i'm working with Symfony and Doctrine, i have a function that will select rows based on specific criteria:
$entities = $repository->getSomeEntities();
now i want to render those entities in a choice list, i checked the entity
FormType but i couldn't achieve what i'm looking for.
Example:
$builder->add('id','entity', array(
'class' => 'Path\To\Entity',
'property' => 'id'
));
the above code works fine except it selects all the Entities.
i checked Symfony documentation http://symfony.com/doc/current/reference/forms/types/entity.html and it seems that the only way to achieve this is by using query_builder option which wont work for my case
Is there anyway to add the $entities
array to my form as a choice list ?