Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. /**
  2. * @return MarcheDAO[] Returns an array of MarcheDAO objects
  3. */
  4. public function findMarcheEnCours($etat)
  5. {
  6. return $this->createQueryBuilder('d')
  7. ->select('d.nomMarche as marche')
  8. ->andWhere('d.etat = :etat')
  9. ->setParameter('etat', $etat)
  10. ->getQuery()
  11. ->getResult();
  12. }
  13.  
  14. public function buildForm(FormBuilderInterface $builder, array $options)
  15. {
  16. $builder
  17. ->add('marche', EntityType::class, [
  18. 'class' => MarcheDAO::class,
  19. 'query_builder' => function(MarcheDAORepository $repo) {
  20. return $repo->findMarcheEnCours(1);
  21. },
  22. 'choice_label' => 'MarcheDAO.nomMarche'
  23.  
  24. ])
  25.  
  26. Argument 1 passed to AppFormSoumissionType::AppForm{closure}() must be an instance of AppFormMarcheDAORepository, instance of AppRepositoryMarcheDAORepository given, called in C:wampwwwAppelsOffresvendorsymfonydoctrine-bridgeFormTypeEntityType.php on line 32
  27.  
  28. 'query_builder' => function(MarcheDAORepository $repo) {..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement