0
$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();
(不是真的用我的代碼「XXX」) 錯誤時:Symfony2的錯誤嘗試在表單創建實體領域
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
似乎實體類中找不到 - 奇怪
謝謝,是一個愚蠢的錯字:) – jeff 2012-04-27 08:24:52