@param int $id

@return AttributeType

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

        return $type;
    }
522160
public function nextChild(int $id): AbstractNode
    {
        $child = $this->getChild($id);
        $next  = $this->children[$child->id()]['next'];
        if (is_null($next)) {
            throw new ChildNotFoundException("Child '$id' next not found in this node.");
        }

        return $this->getChild($next);
    }
646223
public function get($id, ?int $lockMode = null, ?int $lockVersion = null)
    {
        $entity = $this->find($id, $lockMode, $lockVersion);

        if (null === $entity) {
            if (!\is_array($id)) {
                $id = [$this->_class->identifier[0] => $id];
            }

            throw EntityNotFoundException::fromClassNameAndIdentifier(
                $this->getClassName(),
                $this->identifierFlattener->flattenIdentifier($this->_class, $id)
            );
        }

        return $entity;
    }
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;
    }
1307685
public function getById($id): ?AbstractEntity
    {
        $entity = $this->getRepository()->findById($id);

        if ($entity instanceof AbstractEntity) {
            $this->prepareEntityForGet($entity);
        }

        return $entity;
    }
410057
protected function createNotFoundException(string $id): NotFoundExceptionInterface
    {
        return new ServiceNotFoundException($id, end($this->loading) ?: null, array_keys($this->factories));
    }
28913
public function getOriginalEntityState($id)
    {
        if (isset($this->entityStateReferences[$id])) {
            return $this->entityStateReferences[$id];
        }

        return null;
    }
1343134
public function findOrderEntityById($id)
    {
        try {
            return $this->em
                ->getRepository(static::$orderEntityName)
                ->find($id);
        } catch (NoResultException $nre) {
            throw new EntityNotFoundException(static::$orderEntityName, $id);
        }
    }
77964
public function deleteAction($id)
    {
        $contentType = $this->contentTypeManager->getContentTypeById($id);

        if ($contentType === null) {
            throw EntityNotFoundException::fromClassNameAndIdentifier(
                $this->configurationManager->getEntityClass('content_type'),
                [$id]
            );
        }

        $this->om->remove($contentType);
        $this->om->flush();

        return $this->redirectToRoute('sherlockode_acb_content_type_list');
    }
270852
public function get($id)
    {
        if (! $this->has($id)) {
            throw new NotFoundException(
                sprintf('Identifier %s is not defined in container', $id)
            );
        }

        $entry = $this->container[$id]->instance();

        if (is_callable($entry)) {
            return $entry($this);
        }

        return $entry;
    }
983269
public function setId(int $id): Field
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
733805
public static function firstOrNew($id)
    {
        if ($entity = self::getDataMapperInstance()->first($id)) {
            return $entity;
        }

        $entity = new static();
        $entity->_id = $id;

        return $entity;
    }
363287
private function retrieveAttributeById($attributeId)
    {
        $attribute = $this->attributeRepository->find($attributeId);
        if (!$attribute) {
            throw new AttributeNotFoundException($attributeId);
        }

        return $attribute;
    }
1075989
public function findModel($id)
    {
        $model = $this->findModelClassObject($this->modelClass, $id, 'view');
        
        if (!$model) {
            throw new NotFoundHttpException("Unable to find the Model for the given ID");
        }
        
        return $model;
    }
74103
public function getById($id)
    {
        $snapshot = $this->adapter->get(sprintf('%s/snapshots/%s', $this->endpoint, $id));

        $snapshot = json_decode($snapshot);

        return new SnapshotEntity($snapshot->snapshot);
    }
324219
public static function find(int $id): ORM
    {
        if (! ($instance = self::instance()->getById($id))) {
            throw new DatabaseException('Could not find ' . __CLASS__ .
                ' where primary key is ' . $id);
        }
        return $instance;
    }
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;
    }