Merci d'avoir répondu; en effet fallait mettre : j'ai changé car ça m'affiche une erreur :
Catchable Fatal Error: Argument 1 passed to App\SuisseBundle\Entity\PoiMedia::setIdApp() must be an instance of ...\Entity\Poi, null given, called in .../Controller/MediaController.php on line 65 and defined in .../Entity/PoiMedia.php line 198
1 2 3 4 5 6 7 8 9
| public function newAction($idPoi)
{
$em = $this->getDoctrine()->getEntityManager();
$par = $em->getRepository('AppMyBundle:PoiMedia')->find($idApp);
$entity = new PoiMedia();
$entity->setIdApp($par);
$form = $this->createForm(new PoiMediaType($idApp), $entity); |
Partager