I have class contains Foreign key and i want insert this foreign key in my class
I do that script with doctrine 2 and zend 2 :
$geographicalarea = new Geographicalarea();
$geographicalarea = $entityManager()->getRepository('\Synchro\Entity\Geographicalarea')->find (array('idGeographicalArea'=> $idgeographicalarea ));
echo "Create ";
$department = new Department();
$department->setNamedepartment($data ['nameDepartment']);
$department->setCodedepartment($data ['codeDepartment']);
$department->setIdfkgeographicalarea($geographicalarea);
and I get this Error :
Fatal error: Function name must be a string in C:\wamp\www\imprimvert\module\Synchro\src\Synchro\Service\DepartmentManager.php on line 88
$geographicalarea = $entityManager()->getRepository('\Synchro\Entity\Geographicalarea')->find (array('idGeographicalArea'=> $idgeographicalarea ));
how can I resolved that ?
Thanks in advance