(non-PHPdoc).

@see ComBaseControllerBehaviorIdentifiable::fetchEntity()
326778
public function fetchEntity(AnCommandContext $context)
    {
        if ($this->isDispatched()) {
            $username = $this->getRequest()->username;
            if ($username && $this->getRequest()->get('layout') != 'add') {
                $this->setIdentifiableKey('username');
            }
        }

        return parent::fetchEntity($context);
    }
426116
public function fetch()
    {
        $this->parse();
        $parseEvent = new QueryEvent($this);
        $this->getEntityManager()->getEventManager()->dispatch(QueryEvents::PARSE, $parseEvent);

        $result = call_user_func($this->handlers[$this->getOperation()], $this);
        $executeEvent = new QueryEvent($this, $result);
        $this->getEntityManager()->getEventManager()->dispatch(QueryEvents::EXECUTE, $executeEvent);

        return $result;
    }
1022574
public static function gets($data = [], Entity $entity = null)
    {
        if (!$entity) {
            $entity = (new static)->getEntity();
        }

        if (is_scalar($data)) {
            return $entity->where('id', $data)->one();
        } else {
            return $entity->whereArr($data)->one();
        }
    }
820741
public function selectOneEntity (int $key)
    {
        try {
            $this->_prepare['selectOneEntity']->bindParam(1, $key, \PDO::PARAM_INT);
            $this->_prepare['selectOneEntity']->execute();
            
            $r = $this->_prepare['selectOneEntity']->fetchAll(\PDO::FETCH_NUM);
            $this->_prepare['selectOneEntity']->closeCursor();
            if (!empty($r)) :
                return $this->_dataContextObject->dataCallBack( $r[0][1] );
            else :
                return false;
            endif;
        } catch (\Exception $e) {
            throw $e;
        }
    }
29692
public function fetchEntity(AnCommandContext $context)
    {
        $entity = parent::fetchEntity($context);

        //set the entity owner as the context actor of the controller
        if ($entity && $this->getRepository()->isOwnable() && $this->isOwnable()) {
            $this->setActor($entity->owner);
        }

        return $entity;
    }
906703
public function fetch($type=SQLAnywhereClient::FETCH_ASSOC)
	{
		$data = null;
		if ($this->result) {
			switch ($type) {
				case 'array':
					$data = sasql_fetch_array( $this->result );
				break;

				case 'assoc':
					$data = sasql_fetch_assoc( $this->result );
				break;

				case 'row':
					$data = sasql_fetch_row( $this->result );
				break;

				case 'field':
					$data = sasql_fetch_field( $this->result );
				break;

				case 'object':
					$data = sasql_fetch_object( $this->result );
				break;
				
				default:
					$data = sasql_fetch_array( $this->result );
				break;
			}		
		}
		return $data;
	}
946242
static function fetch( $id, $asObject = true, $version = eZPDFExport::VERSION_VALID )
    {
        return eZPersistentObject::fetchObject( eZPDFExport::definition(),
                                                null,
                                                array( 'id' => $id,
                                                       'version' => $version ),
                                                $asObject );
    }
551052
public function getEntity()
    {
        //if there is no entity
        if ($this->entity === null) {
            //we try to get one from the proxy
            $entityProxy = $this->getEntityProxy();

            //if there is a proxy
            if ($entityProxy !== null && $this->getBusinessEntityId()) {
                $entity = $entityProxy->getEntity($this->getBusinessEntityId());
                $this->entity = $entity;
            }
        }

        return $this->entity;
    }
415158
public function getEntityById($id)
    {
        return isset($this->entitiesById[$id]) ? $this->entitiesById[$id] : null;
    }
158694
private function getEntityGetter($entity, $property)
    {
        $getter = null;

        $prefixes = ['get', 'is', 'has', ''];

        foreach ($prefixes as $prefix) {
            $test = $prefix.ucfirst($property);
            if (method_exists($entity, $test)) {
                $getter = $test;
                break;
            }
        }

        if (null === $getter) {
            throw new \LogicException("Entity has no getter for property `{$property}`.");
        }

        return $getter;
    }
777446
public function fetchEntity(AnCommandContext $context)
    {
        if (!$this->_entity) {
            if ($entity = $this->getService('com:settings.domain.entity.template')->load($this->alias)) {
                $this->_entity = $entity;
            }
        }

        return $this->_entity;
    }
740937
public final function detectFetchType($fetchType): int
    {
        switch (gettype($fetchType)) {
            case 'NULL':
                return ResultInterface::AS_OBJECT;
            case 'integer':
                if (in_array($fetchType, [ResultInterface::AS_OBJECT, ResultInterface::AS_ARRAY_ASC,
                    ResultInterface::AS_ARRAY_NUM, ResultInterface::AS_ARRAY_ASCNUM])) {
                    return $fetchType;
                }
                break;
            case 'string':
                // shorthands
                if ($fetchType == 'array') return ResultInterface::AS_ARRAY_ASC;
                if ($fetchType == 'object') return ResultInterface::AS_OBJECT;

                //  object, array_asc etc.
                $fetchTypeConst = 'Oppa\Query\Result\ResultInterface::AS_'. strtoupper($fetchType);
                if (defined($fetchTypeConst)) {
                    return constant($fetchTypeConst);
                }

                // user classes
                if (class_exists($fetchType)) {
                    $this->setFetchObject($fetchType);

                    return ResultInterface::AS_OBJECT;
                }
                break;
        }

        throw new InvalidValueException("Given '{$fetchType}' fetch type is not implemented!");
    }
1039695
public static function getEntity(\Twizo\Api\AbstractEntity $entity)
    {
        $result = '';
        $values = self::getEntityValues($entity);

        $result .= str_repeat('-', strlen(get_class($entity)) + 4) . PHP_EOL;
        $result .= '| ' . get_class($entity) . ' |' . PHP_EOL;
        $result .= str_repeat('-', strlen(get_class($entity)) + 4) . PHP_EOL;

        foreach ($values as $method => $value) {
            $result .= substr($method, 3) . ' : ' . var_export($value, true) . PHP_EOL;
        }

        return $result;
    }
746351
public function execute($fetchType = null)
    {
        if (!$fetchType) {
            $fetchType = $this->fetchType;
        }

        switch ($fetchType) {
            case (!\is_int($fetchType)):
                return Db::fetchObjects($this->getSql(), $this->params, $fetchType);
            case \PDO::FETCH_CLASS:
                return Db::fetchObjects($this->getSql(), $this->params);
            case \PDO::FETCH_ASSOC:
            default:
                return Db::fetchAll($this->getSql(), $this->params);
        }
    }
1135351
protected function compileEntity()
    {
        if ($this->compiledEntity === null) {
            Loader::includeModule('highloadblock');
            global $USER_FIELD_MANAGER;
            $USER_FIELD_MANAGER->CleanCache();
            $hlblock = $this->infrastructureCheck();
            $entity = HighloadBlockTable::compileEntity($hlblock);
            $this->compiledEntity = $entity->getDataClass();
        }

        return $this->compiledEntity;
    }
928743
private <E> E fetch(Class<E> entityClass, Key nativeKey) {
    try {
      Entity nativeEntity = nativeReader.get(nativeKey);
      E entity = Unmarshaller.unmarshal(nativeEntity, entityClass);
      entityManager.executeEntityListeners(CallbackType.POST_LOAD, entity);
      return entity;
    } catch (DatastoreException exp) {
      throw new EntityManagerException(exp);
    }
  }
43142
private AbstractRESTEntity asEntity(byte[] responseBody, Class<?> clazz)
        throws Exception {

        AbstractRESTEntity entity = null;

        entity = (AbstractRESTEntity) mapper.readValue(responseBody, clazz);

        return entity;
    }