Action_Helper_Entity::get PHP Метод

get() публичный Метод

Get entity by parameter
public get ( mixed $entity, string $key = 'id', boolean $throw = TRUE ) : object | null
$entity mixed
$key string
$throw boolean
Результат object | null
    public function get($entity, $key = 'id', $throw = TRUE)
    {
        $params = $this->getRequest()->getParams();
        if (!isset($params[$key])) {
            if ($throw) {
                throw new InvalidArgumentException();
            }
            return NULL;
        }
        $match = $this->em->find($this->getClassName($entity), $params[$key]);
        if (!$match) {
            if ($throw) {
                throw new InvalidArgumentException();
            }
            return NULL;
        }
        return $match;
    }