$tip->setGame($em->getRepository('XXXBundle:Game')->find($id));
$form = $this->createFormBuilder($tip)->add('player', 'entity', array(
'class' => 'XXXBundle::FootballPlayer',
/*'query_builder' => function(\XXX\XXXBundle\Entity\FootballPlayerRepository $er)
{
$er->findByCurteam($team->getName());
},*/
))->getForm();
(not really using ‘XXX’ in my code)
error:
Warning: class_parents(): Class XXX\XXXBundle\Entity\ does not exist
and could not be loaded in
D:\www\xxx\xxx\vendor\doctrine\lib\Doctrine\ORM\Mapping\ClassMetadataFactory.php
line 223
seems the Entity class is not found – strange
Something is strange in your code:
'class' => 'XXXBundle::FootballPlayer',are you sure::exist? Never seen it, seems like a mistake (maybe can provoke the error).After testing, yes, it’s because of the double
::replace by::'class' => 'XXXBundle:FootballPlayer',.