@param int $id

@return SolrDocument|null
546552
public function get($id)
    {
        $result = $this->query('+id:'.$id);

        if ($result->getNumFound() > 0) {
            $docs = $result->getDocs();

            return $docs[0];
        }

        return null;
    }
525854
public function findNeedById($id)
    {
        // No needs defined yet.
        if (is_null($this->needs)) {
            return null;
        }

        // Traverse and Return.
        return $this->traverseNodesAndFindBy('trait_id', $id, $this->needs);
    }
718345
public function getParentId($id)
    {
        $path = $this->getProperty($id, self::PATH);
        array_pop($path);

        return empty($path)
            ? null // the given item is the root
            : array_pop($path);
    }
1165348
public static function find($collection, $id)
    {
        $id = intval($id);
        foreach ($collection as $entity) {
            if ($id === $entity->getId()) {
                return $entity;
            }
        }

        return null;
    }
978840
public static function findById($id)
    {
        if (!$id || strlen($id) != 24) {
            return null;
        }
        $instance = static::entity()->get(get_called_class(), $id);
        if ($instance) {
            return $instance;
        }
        $mongo = static::entity()->getDatabase();
        $data = $mongo->findOne(static::$collection, ['_id' => $mongo->id($id)]);
        if (!$data) {
            return null;
        }
        $instance = new static;
        $data['__webiny_db__'] = true;
        $instance->populate($data);

        return static::entity()->add($instance);
    }
879018
public function getResult($id)
    {
        return isset($this->results[$id]) ? $this->results[$id] : null;
    }
52696
public function index($id = null)
    {
        $this->authorize('readList', Content::class);
        $input  = $this->validator->validate('list');
        $params = $this->processor->process($input)->getProcessedFields();
        if ($id) { // content/id/children
            $content = $this->repository->getById($id);
            if (!empty($content)) {
                $results = $this->repository->getChildren(
                    $content,
                    $params['filter'],
                    $params['orderBy'],
                    $params['page'],
                    $params['perPage']
                );
                return $this->respondWithSuccess($results, new ContentTransformer);
            } else {
                return $this->respondNotFound();
            }
        }

        $results = $this->repository->getContents(
            $params['filter'],
            $params['orderBy'],
            $params['page'],
            $params['perPage']
        );

        return $this->respondWithSuccess($results, new ContentTransformer);
    }
1014575
private function load($id = null)
    {

        $this->initialize();
        $this->id = $id;
        return $this->getDataConnector()->loadContext($this);

    }
583300
public function get($id)
    {
        $resolved = $this->getResolved($id);

        return $resolved ? $resolved->getInnerExtension() : null;
    }
1205026
public function getEntity($id = 0)
    {
        try {
            $q = $this->createQueryBuilder($this->getTableAlias());
            if (is_array($id)) {
                $this->buildSelectClause($q, $id);
                $extendedFieldId = $id['id'];
            } else {
                $extendedFieldId = $id;
            }
            $idArray   = explode('@', $extendedFieldId);
            $leadId    = isset($idArray[0]) && !is_null($idArray[0]) ? $idArray[0] : null;
            $leadField = isset($idArray[1]) && !is_null($idArray[1]) ? $idArray[1] : null;
            $q->andWhere($this->getTableAlias().'.lead = '.$leadId);
            $q->andWhere($this->getTableAlias().'.leadField = '.$leadField);
            $entity = $q->getQuery()->getSingleResult();
        } catch (\Exception $e) {
            $entity = null;
        }

        if (null != $entity && isset($extendedFieldId)) {
            // @todo - likely needs refactoring...
            $fieldValues = $this->getFieldValues($extendedFieldId, true, 'extendedField');
            $entity->setFields($fieldValues);
        }

        return $entity;
    }
690298
public function get($id)
    {
        $document = $this->getFileCollection()->findOne(['_id' => $id]);
        return empty($document) ? null : $this->createDownload($document);
    }
426494
public static function find($id)
    {
        self::init();
        $query = 'SELECT * FROM ' . self::$modelTable . ' WHERE id = '.$id;
        $qb = new QueryBuilder(self::$connect, $query);
        $rows = $qb->get();
        $collection = self::makeCollection($rows);
        return !empty($collection) ? array_shift($collection) : null;
    }
757557
public function encodeId($id = '')
    {
        if (empty($id)) {
            return NULL;
        }
        try {
            $hash = new Hashids($this->hashIds['salt'], $this->hashIds['minHashLength'], $this->hashIds['alphabet']);

            return $hash->encode($id);
        }
        catch (\Exception $e) {
            if (function_exists('log_message')) {
                $message = 'Error Code: ' . $e->getCode() . ' - File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Message: ' . $e->getMessage();
                log_message('error', $message);
            }

            return NULL;
        }
    }
788689
public function readSession($id)
    {
        $data = $this->cache->get($this->calculateKey($id));

        return $data === null ? '' : $data;
    }
20558
public function find(int $id)
    {
        return $this->cache->tags($this->getModel())->remember($id, 60, function () use ($id) {
            return $this->repository->find($id);
        });
    }
357266
public static function getFromCache($id)
    {
        $arrayCache = Configuration::getArrayCache();
        if ($arrayCache->contains($id)) {
            return $arrayCache->fetch($id);
        }

        $cacheDriver = Configuration::getCacheDriver();
        if ($cacheDriver !== null) {
            $cacheResult = $cacheDriver->fetch($id);
            if ($cacheResult !== false) {
                $arrayCache->save($id, $cacheResult);
                return $cacheResult;
            }
        }

        return null;
    }
684176
public function findOneById($id)
    {
        $persister = $this->entityManager->getEntityPersister($this->className);

        return $persister->loadOneById($id);
    }