Finds an identity by the given ID.
@param  string|int $id
@return null|Identity
348162
public static function findIdentity($id) : ?Identity
    {
        $user = self::getRepository()->findActiveById($id);
        return $user ? new self($user) : null;
    }
773718
public function id($id = null)
    {
        if (is_null($id)) {
            return $this->id;
        }

        $this->id = $id;

        return $this;
    }
590268
public function get($id)
    {
        foreach ($this->items as $item) {
            if ($item->id === $id) {
                return $item;
            }
        }
        return null;
    }
193218
protected function getAbstractId($id)
    {
        if (isset($this->aliases[$id])) {
            $id = $this->aliases[$id];
        }

        return $id;
    }
1133581
public function getById($id)
    {       
        if (!is_null($this->_table) && !is_null($id)) {
            $this->_sql = "SELECT * FROM $this->_table WHERE id = $id";
            $row = $this->_select($this->_sql);
            return (isset($row[0])) ? $row[0] : null;
        }
    }
1269934
public function findIdentityById(int $identityId): Entity\Identity
    {
        $identity = new Entity\Identity;
        $identity->setId($identityId);

        $this->repository->load($identity, Entity\Identity::class);

        if ($identity->getAccountId() === null) {
            $this->logger->notice('identity not found', [
                'input' => [
                    'id' => $identityId,
                ],
            ]);

            throw new IdentityNotFound;
        }

        return $identity;
    }
534460
function get_identity($id = null)
    {
        $id = (int)$id;
        // cache identities for better performance
        if (!array_key_exists($id, $this->identities)) {
            $result = $this->list_identities($id ? "AND `identity_id` = $id" : '');
            $this->identities[$id] = $result[0];
        }

        return $this->identities[$id];
    }
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);
    }
946650
public static function find_by_id($id)
	{
		$hzad = self::oneOrNew($id);

		if (!$hzad->get('authenticator'))
		{
			return false;
		}

		return $hzad;
	}
1317814
private function doFind($id)
    {
        $id = $this->toIdentity($id);
        $entity = null === $id ? null : $this->em->find($this->class, $id);

        if (null === $entity) {
            throw EntityNotFoundException::createForId($this->class, $id);
        }

        return $entity;
    }
1352414
public function findById($id)
	{
		$model = $this->createModel();

		$user = $model->where('id', '=', $id)->find();

		if ( ! $user->loaded() )
		{
			throw new UserNotFoundException("A user could not be found with ID [$id].");
		}

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

        return $persister->loadOneById($id);
    }
245251
public function findCacheById(int $id)
    {

        // Check if already in addToCache
        if ($this->isCachedById($id)) {
            return $this->cacheById[$id];
        }

        return null;
    }
1022361
public function find(int $id)
    {
        $response = $this->model->with($this->with)->find($id);
        $this->with = [];
        return $response;
    }
796029
public static function get($id){
		if( isset(self::$instances[$id]) ){
			return self::$instances[$id];
		}
		return null;
	}
1012396
public function findOneById($id)
    {
        $qb = $this->getQueryBuilder();

        return $qb
            ->leftJoin('c.rows', 'row')
            ->leftJoin('row.blocks', 'block')
            ->leftJoin('block.translations', 'translation')
            ->addSelect('row', 'block', 'translation')
            ->andWhere($qb->expr()->eq('c.id', ':id'))
            ->getQuery()
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, Container::getEntityTagPrefix() . '[id:'.$id.']')
            ->setParameter('id', $id)
            ->getOneOrNullResult();
    }
972663
public function findUserById($id)
    {
        if ($id instanceof UserInterface) {
            return $id;
        }

        $result =   $this->userProvider->findById($id);
        if ($result) {
            return $result;
        }

        $exceptionMessage   =   "A user with the ID '%(id)s' cannot be found.";

        throw new UserNotFound(isprintf($exceptionMessage, compact('id')));
    }