Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 public function getByBusinessEntityAndId(BusinessEntity $businessEntity, $id)
 {
     return $this->entityManager->getRepository($businessEntity->getClass())->findOneById($id);
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }