1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
->add('categorie','entity',
array('class'=>'annonces\AnnonceBundle\Entity\Categorie',
'property'=>'nom',
'query_builder' => function (\annonces\AnnonceBundle\Entity\CategorieRepository $repository)
{
return $repository->createQueryBuilder('s')
->where('s.idparent = 0')
->andWhere('s.type = :type')
->setParameter('type', 'annone')
->add('orderBy', 's.nom ASC');
} ,
'empty_value' => 'Catégories',
))
->add('activite', 'choice', array('choices' => array('Sous catégories') ))
->add('nom') |
Partager