protected function getEntity($class, $name)
    {
        if (isset($this->entities[$class][$name])) {
            return $this->entities[$class][$name];
        } elseif ($this->hasReferencer() && $this->getReferencer()->hasReference($name)) {
            return $this->getManager()->merge($this->getReferencer()->getReference($name));
        }
        throw new \Exception(sprintf("No entity found for name '%s'.", $name));
    }
protected function getEntity($class, $name)
    {
        if (isset($this->entities[$class][$name])) {
            return $this->entities[$class][$name];
        } elseif ($this->hasReferencer() && $this->getReferencer()->hasReference($name)) {
            return $this->getManager()->merge($this->getReferencer()->getReference($name));
        }
        throw new \Exception(sprintf("No entity found for name '%s'.", $name));
    }
protected function getEntity ( $ class , $ name ) { if ( isset ( $ this -> entities [ $ class ] [ $ name ] ) ) { return $ this -> entities [ $ class ] [ $ name ] ; } elseif ( $ this -> hasReferencer ( ) && $ this -> getReferencer ( ) -> hasReference ( $ name ) ) { return $ this -> getManager ( ) -> merge ( $ this -> getReferencer ( ) -> getReference ( $ name ) ) ; } throw new \ Exception ( sprintf ( "No entity found for name '%s'." , $ name ) ) ; }
Get existing entity by reference or same file loading

@author Vincent CHALAMON <vincentchalamon@gmail.com>

@param string $class Class name
@param string $name  Entity name

@return object     Entity
@throws \Exception No entity found
Get existing entity by reference or same file loading