php - The class 'Doctrine\ORM\EntityManager' was not found in the chain configured namespaces XXX -
i have read the other questions concerning issue have not come across solution of yet.
i following error message:
the class 'doctrine\orm\entitymanager' not found in chain configured >namespaces zfcuser\entity, common\entity, employment\entity, intern\entity, >team\entity, purchaserequest\entity.
i have holidayentity, holidaycontroller, holidayservice.
adding holiday works, when try remove holiday error pops up. pass holiday id controller service, fetches associated object , runs doctrine 2 removeentity command.
i unsure how tackle problem @ moment.
controller code:
public function deleteaction() { $holidayid = $this->params()->fromroute('id', 0); try { $this->getservicelocator()->get('holidayservice')->removeholiday($holidayid); } catch (exception $e) { $this->flashmessenger()->adderrormessage($e->getmessage() . '<br>' . $e->gettraceasstring()); } return $this->redirect()->toroute('holiday/list'); }
service code:
public function removeholiday($holidayid) { try{ $holiday = $this->findoneholidaybyid($holidayid); $this->removeentity($holiday); } catch (exception $e) { var_dump($e); } } protected function removeentity($entity) { $this->getentitymanager()->remove($entity); $this->getentitymanager()->flush(); }
the code breaks in "$this->getentitymanager()->remove($entity)" method.
the error getting relates doctrine not being able find entity called doctrine\orm\entitymanager
, wrong.
my guess somewhere (perhaps in getentitymanager()
method) passing instance of entity manager entity manager.
for example
$entitymanager = new entitymanager(); $entity = new entitymanager(); $entitymanager->remove($entity);
Comments
Post a Comment