Bundle/BusinessEntityBundle/Helper/BusinessEntityHelper.php
public function getEntityByPageAndBusinessIdentifier(BusinessTemplate $page, $entityIdentifier, $attributeName)
    {
        if (!$this->entityManager) {
            throw new \Exception('EntityManager not defined, you should use the "victoire_core.helper.queriable_business_entity_helper" service');
        }
        $entity = null;

        $businessEntityId = $page->getBusinessEntityId();

        $businessEntity = $this->findById($businessEntityId);

        //test the result
        if ($businessEntity === null) {
            throw new \Exception('The business entity ['.$businessEntityId.'] was not found.');
        }

        $entity = $this->findEntityByBusinessEntityAndAttribute($businessEntity, $attributeName, $entityIdentifier);

        //test the result
        if ($entity === null) {
            throw new \Exception('The entity ['.$entityIdentifier.'] was not found.');
        }

        return $entity;
    }
public function getEntityByPageAndBusinessIdentifier(BusinessTemplate $page, $entityIdentifier, $attributeName)
    {
        if (!$this->entityManager) {
            throw new \Exception('EntityManager not defined, you should use the "victoire_core.helper.queriable_business_entity_helper" service');
        }
        $entity = null;

        $businessEntityId = $page->getBusinessEntityId();

        $businessEntity = $this->findById($businessEntityId);

        //test the result
        if ($businessEntity === null) {
            throw new \Exception('The business entity ['.$businessEntityId.'] was not found.');
        }

        $entity = $this->findEntityByBusinessEntityAndAttribute($businessEntity, $attributeName, $entityIdentifier);

        //test the result
        if ($entity === null) {
            throw new \Exception('The entity ['.$entityIdentifier.'] was not found.');
        }

        return $entity;
    }
public function getEntityByPageAndBusinessIdentifier ( BusinessTemplate $ page , $ entityIdentifier , $ attributeName ) { if ( ! $ this -> entityManager ) { throw new \ Exception ( 'EntityManager not defined, you should use the "victoire_core.helper.queriable_business_entity_helper" service' ) ; } $ entity = null ; $ businessEntityId = $ page -> getBusinessEntityId ( ) ; $ businessEntity = $ this -> findById ( $ businessEntityId ) ; //test the result if ( $ businessEntity === null ) { throw new \ Exception ( 'The business entity [' . $ businessEntityId . '] was not found.' ) ; } $ entity = $ this -> findEntityByBusinessEntityAndAttribute ( $ businessEntity , $ attributeName , $ entityIdentifier ) ; //test the result if ( $ entity === null ) { throw new \ Exception ( 'The entity [' . $ entityIdentifier . '] was not found.' ) ; } return $ entity ; }
Get the entity from the page and the id given.
Must be called by the service victoire_core.helper.queriable_business_entity_helper.

@param BusinessTemplate $page             The page
@param string           $entityIdentifier The identifier for the business entity
@param string           $attributeName    The name of the attribute used to identify an entity

@throws \Exception

@return entity
Get the entity from the page and the id given . Must be called by the service victoire_core . helper . queriable_business_entity_helper .