Sowie find() aber mit Exception, erwartet nur ein Ergebnis

@throws \Psc\Doctrine\EntityNotFoundException
@TODO was passiert hier bei uneindeutigkeit?
494673
public function hydrate($identifier) {
    $entity = $this->find($identifier);
    
    if (!($entity instanceof $this->_entityName)) {
      throw new EntityNotFoundException(
        sprintf("Entity: '%s' nicht gefunden: identifier: %s",
                $this->_entityName, Code::varInfo($identifier)));
    }
    
    return $entity;
  }
120892
public function getChildren($id)
    {
        $location = $this
            ->locationRepository
            ->findOneBy([
                'id' => $id,
            ]);

        if (empty($location)) {
            throw new EntityNotFoundException();
        }

        return $this->formatOutputLocationArray(
            $location->getChildren()
        );
    }
1357132
public function hydrateBy(array $criterias) {
    $entity = $this->findOneBy($criterias);
    
    if (!($entity instanceof $this->_entityName)) {
      throw new EntityNotFoundException(sprintf('Entity %s nicht gefunden: criterias: %s', $this->_entityName, Code::varInfo($criterias)));
    }
    
    return $entity;
  }
819620
public function findOrderEntityById($id)
    {
        try {
            return $this->orderRepository->find($id);
        } catch (NoResultException $nre) {
            throw new EntityNotFoundException(static::$orderEntityName, $id);
        }
    }
688231
protected function lookUpEntity($entityId) {
        $entity = $this->generateEntity();
        $entityInstance = $entity->findFirst($entityId);
        if($entityInstance === false) {
            throw new Exception("Invalid Entity Id: Entity not found.", 404);
        }
        return $entityInstance;
    }
220300
public function findOne()
    {
        $this->updateMap();

        return $this->entityRepository->findOne()->with('id', Operator::IN, $this->map);
    }
506482
public function getSearchableEntityMeta($entityName)
    {
        $allMeta = $this->getSearchableEntitiesMeta();

        if (!isset($allMeta[$entityName])) {
            throw new SearchException(sprintf('Entity "%s" is not searchable.', $entityName));
        }

        return $allMeta[$entityName];
    }
614510
public function findAll()
    {
        $keys = $this->getFileManager()->keys();
        $entities = array();
        if(is_array($keys)) {
            foreach($keys as $key) {
                if(preg_match('/^'.$this->getHash().'/', $key)) {
                    $entities[] = $this->loadEntity($key);
                }
            }
        }
        
        return $entities;
    }
753993
public function findObject($entity, $_id)
	{
		$retValue = array();

		try{
			$m = new MongoDB\Driver\Manager($this->url);

			$id = new \MongoDB\BSON\ObjectId($_id);
			$filter = ['_id' => $id];
			$options = [];

			$query = new \MongoDB\Driver\Query($filter, $options);
			$mCol = $this->db . "."  . $entity;
			$jsonData = $m->executeQuery($mCol, $query);

			$retValue = $jsonData->toArray();
		}
		catch(Exception $e) {
			$this->_log->addError($e->getMessage());
		}

		return $retValue;
	}
1034091
protected function findIdCompanyBusinessUnit(string $companyBusinessUnitKey): int
    {
        if (!isset($this->idCompanyBusinessUnitCache[$companyBusinessUnitKey])) {
            $idCompanyBusinessUnit = SpyCompanyBusinessUnitQuery::create()
                ->select(SpyCompanyBusinessUnitTableMap::COL_ID_COMPANY_BUSINESS_UNIT)
                ->findOneByKey($companyBusinessUnitKey);

            if (!$idCompanyBusinessUnit) {
                throw new EntityNotFoundException(sprintf('Could not find Company Business Unit by key "%s"', $companyBusinessUnitKey));
            }

            $this->idCompanyBusinessUnitCache[$companyBusinessUnitKey] = $idCompanyBusinessUnit;
        }

        return $this->idCompanyBusinessUnitCache[$companyBusinessUnitKey];
    }
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;
	}
328466
public function find( $key, $disableLateLoading = null )
    {

        // $disableLateLoading default value management
        if( !is_bool( $disableLateLoading ) ) {
            $disableLateLoading = false;
        }

        // empty key
        if( is_null( $key ) or !is_scalar( $key ) or strlen( trim( $key ) ) === 0 ) {
            return null;
        }

        $class = $this->entityClass;

        try {
            return $this->entityFactory( $key, $disableLateLoading );
        } catch( \Exception $e ) {
            return null;
        }

    }
996198
private function locateDescription($entityClass)
    {
        $entityName     = preg_replace('~^.*?(\w+)$~', '\1', $entityClass);
        $definitionFile = $entityName . '.xml';
        $filename       = $this->locator->findFile($definitionFile);

        if (!is_null($filename)) {
            return $filename;
        }

        throw new EntityNotDefinedException($entityClass);
    }
1343134
public function findOrderEntityById($id)
    {
        try {
            return $this->em
                ->getRepository(static::$orderEntityName)
                ->find($id);
        } catch (NoResultException $nre) {
            throw new EntityNotFoundException(static::$orderEntityName, $id);
        }
    }
36828
public static function find($fields = '*')
    {
        $entity = new static();
        if ($fields == '*') {
            $fields = $entity->getTableName() .'.*';
        }
        Entity\Manager::getInstance()->get($entity)->refreshRelations();
        $select = new \Slick\Orm\Sql\Select($entity, $fields);
        return $select;
    }
341396
public function search($entityName, $query)
    {
        $meta = $this->getSearchableEntityMeta($entityName);

        $qb = $this->em->getRepository($meta->getEntityClass())->createQueryBuilder('o');

        if ($this->translationJoiner->isTranslatable($meta->getEntityClass())) {
            $this->translationJoiner->joinTranslation($qb, true, null, null, true);
        }

        $searchableFields = $this->getSearchableFields($meta);

        try {
            $this->filterer->filter($qb, array_fill_keys($searchableFields, $query), [
                'non_strict_comparison_fields' => $searchableFields,
            ], false);
        } catch (FiltererException $ex) {
            throw new SearchException(
                sprintf('Unable to search for "%s" entities: "%s".', $meta->getEntityClass(), $ex->getMessage())
            );
        }
        try {
            return $qb->getQuery()->getResult();
        } catch (QueryException $ex) {
            throw new SearchException(
                sprintf('Unable to search for "%s" entities: "%s".', $meta->getEntityClass(), $ex->getMessage())
            );
        }
    }
97140
public function findObject($entity, $_id)
	{
		$retValue = array();

		$query = array('_id' => $_id);

		if (! is_null($this->_conn)){
			$retValue = $this->_conn->select($entity, '*', $query);

			if ($this->error($this->_conn->error()))
				$retValue = array();
		}

		$retValue = array('data' => $retValue);

		return $retValue;
	}