Find an entity by its Id

@param  integer $entityId
@param  string $entityType

@return Object|null
341799
public function findByEntityId($entityId, $entityType)
    {
        $item = $this->model->where('entity_type', $entityType)->where('entity_id', $entityId)->first();

        if ($item && ($item->data->is_published == 1 || $item->data->is_published == 'on') && $item->data->published_at <= Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s')) {
            return $item->data;
        }

        return null;
    }
696745
public function findAllByEntityId($entityId)
    {

        // prepare the params
        $params = array(ParamNames::ENTITY_ID => $entityId);

        // load and return the customer varchar attributes with the passed entity ID
        $this->customerVarcharsStmt->execute($params);
        return $this->customerVarcharsStmt->fetchAll(\PDO::FETCH_ASSOC);
    }
17690
public CmsEntity getEntityById(String entityId) {

        CmsEntity result = null;
        if (m_id.equals(entityId)) {
            result = this;
        } else {
            for (List<CmsEntity> children : m_entityAttributes.values()) {
                for (CmsEntity child : children) {
                    result = child.getEntityById(entityId);
                    if (result != null) {
                        break;
                    }
                }
                if (result != null) {
                    break;
                }
            }
        }
        return result;
    }
375437
public function getOrderTypeEntityById($typeId)
    {
        // Get desired status.
        $typeEntity = $this->orderTypeRepository->find($typeId);
        if (!$typeEntity) {
            throw new EntityNotFoundException($this->orderTypeRepository->getClassName(), $typeId);
        }

        return $typeEntity;
    }
995562
private function lookupEiEntityObj($id, int $ignoreConstraintTypes = 0): EiEntityObj {
		$criteria = $this->eiFrame->createCriteria('e', $ignoreConstraintTypes);
		$criteria->select('e');
		$this->applyIdComparison($criteria->where(), $id);
		
		if (null !== ($entityObj = $criteria->toQuery()->fetchSingle())) {
			return EiEntityObj::createFrom($this->eiFrame->getContextEiEngine()->getEiMask()->getEiType(), $entityObj);
		}
		
		throw new UnknownEiObjectException('Entity not found: ' . EntityInfo::buildEntityString(
				$this->getContextEiType()->getEntityModel(), $id));
		
	}
1007184
public function getById($entityType, $id, array $params = [], $version = null)
    {
        if (empty($id)) {
            throw new Exception('Id is empty');
        }

        if (!static::isIdValid($id)) {
            throw new Exception('Id is invalid, please use a correctly formatted id');
        }

        return ($version === null)
            ? $this->doGet($entityType . '.json/crud/' . $id, $params)
            : $this->doGet($entityType . '.json/history/' . $id . '/' . $version, $params);
    }
646477
public function find($entityName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null)
    {
        return $this->getRepository($entityName)->find($identifier, $lockMode, $lockVersion);
    }
150260
public function findObject($entity, $_id)
	{
		$retValue = array();

		try{
			$query = array('_id' => new MongoId($_id));

			if (! is_null($this->_db)){
				$mongo = $this->_db->selectCollection($entity);

				// Find Object
				$retValue = $mongo->findOne($query);

				if (is_null($retValue))
					$retValue = array();
			}
		}
		catch(Exception $e) {
			$this->_log->addError($e->getMessage());
		}

		return $retValue;
	}
834038
public function find($entityId)
    {
        $this->preFind($entityId);
        $entity = $this->doFind($entityId);
        $this->postFind($entity);

        return $entity;
    }
187800
protected function getType($id)
    {
        $type = $this->attributeTypeRepository->find($id);
        if (!$type) {
            throw new EntityNotFoundException(AttributeType::class, $id);
        }

        return $type;
    }
1340913
protected function loadEntities(array $entityIds)
    {
        if (count($entityIds) === 0) {
            return null;
        }

        $entities = [];

        // Create and store the entities associated with each Id
        foreach ($entityIds as $entityId) {
            $hash = $this->getEntityHashById($entityId);

            if ($hash === null) {
                return null;
            }

            $entities[] = $this->loadEntity($hash);
        }

        return $entities;
    }
1221655
public function getTranslation(
        $entityType,
        $entityId,
        $entityField,
        $locale
    ) {
        $cacheKey = $this->buildKey(
            $entityType,
            $entityId,
            $entityField,
            $locale
        );

        $translation = $this
            ->cache
            ->fetch($cacheKey);

        if ($translation === false) {
            $translation = $this
                ->entityTranslatorProvider
                ->getTranslation(
                    $entityType,
                    $entityId,
                    $entityField,
                    $locale
                );

            $this
                ->cache
                ->save(
                    $cacheKey,
                    $translation
                );
        }

        return $translation;
    }
699029
public function getId($entityType, array $selector = [])
    {
        $params = ['limit' => 1];
        $ids = (array)$this->getIds($entityType, $selector, $params);

        return array_shift($ids);
    }
1009326
static function get_entity($uri)
    {
        if (isset(self::$list_entity[$uri])){
            return self::$list_entity[$uri];
        }
        return null;
    }
481724
public function loadEntity($entity, $entity_id)
    {
        try {
            $handlers = $this->getHandlers();
            return Handler::call($handlers, $entity, 'data', array($entity_id));
        } catch (Exception $ex) {
            return array();
        }
    }
1206304
public function copy($entityId)
    {
        $this->preCopy($entityId);
        $entity = $this->doCopy($entityId);
        $entity = $this->postCopy($entity);
        $this->getEntityManager()->flush($entity);

        return $entity;
    }
791594
public function find($id)
    {
        $key = $this->getHash().$id;
        if($this->getFileManager()->has($key)) {
            return $this->loadEntity($key);
        }
        
        return null;
    }