/** * Must be called by the service victoire_core.helper.queriable_business_entity_helper. * * @param BusinessEntity $businessEntity * @param $id * * @throws \Exception * * @return mixed */ public function getByBusinessEntityAndId(BusinessEntity $businessEntity, $id) { if (!$this->entityManager) { throw new \Exception('EntityManager not defined, you should use the "victoire_core.helper.queriable_business_entity_helper" service'); } return $this->entityManager->getRepository($businessEntity->getClass())->findOneById($id); }
public function getByBusinessEntityAndId(BusinessEntity $businessEntity, $id) { return $this->entityManager->getRepository($businessEntity->getClass())->findOneById($id); }
/** * save BusinessEntity. */ public function saveBusinessEntity(BusinessEntity $businessEntity) { $businessEntities = $this->cache->get(BusinessEntity::CACHE_CLASSES); $businessEntities[$businessEntity->getClass()] = $businessEntity; $this->cache->save(BusinessEntity::CACHE_CLASSES, $businessEntities); }