Prüft nach und nach in allen $criteria-Arrays in $criterias nach einem Vorkommen in diesem Repository

wird keins gefunden, wird eine Doctrine\ORM\NoResultException geworden
@throws Doctrine\ORM\NoResultException
192011
public function findOneByCriterias(Array $criterias) {
    foreach ($criterias as $criteria) {
      try {
        if (!is_array($criteria)) throw new \InvalidArgumentException('Elemente von $criterias müssen Arrays sein. '.Code::varInfo($criterias));
        $object = $this->findOneBy($criteria);
        
        if ($object != null) return $object;
      } catch (NoResultException $e) {
        
      }
    }
    
    throw new NoResultException();
  }
66647
public function unique($criteria = null, array $values = array())
    {
        if (!$this->_properties['primary_key'] || (!$values && !$criteria))
            throw new Exception(sprintf(self::E_PrimaryKey, get_called_class()), 1);

        $that = clone $this;
        $values ? $that->find($criteria, $values) : $that->findByPK($criteria);

        return ($that->dry() || $this->pkCompare($that->pkValue()));
    }
277808
public function find($criteria = [], array $fields = []) {
		$criteriaNormalized = $this->normalizeCriteria($criteria);
		
		$mongoCursor = $this->getAdapter()->find(
			$this->getTableName(),
			$criteriaNormalized,
			$fields
		);
		
		if ($criteria instanceof Criteria) {
			$this->applyCriteriaToCursor($criteria, $mongoCursor);
		}
		
		return $this->createResultset($mongoCursor);
	}
886864
public static function findOneByCriteria(array $criteria): ?self
    {
        try {
            list($columns, $values, $options) = static::parseCriteria($criteria);
        } catch (NoTagsException $e) {
            return null;
        }

        if (\count($columns) < 1) {
            return null;
        }

        return static::findOneBy($columns, $values, $options);
    }
23859
public function findOneBy(array $criteria) : ?array
    {
        foreach ($this->objects as $object) {
            $matches = true;

            foreach ($criteria as $key => $value) {
                if ($object[$key] === $value) {
                    continue;
                }

                $matches = false;
            }

            if ($matches) {
                return $object;
            }
        }

        return null;
    }
797939
public function findBy(
        array $criteria,
        ?array $orderBy = null,
        ?int $limit = null,
        ?int $offset = null
    ) : array {
        $objects = [];

        foreach ($this->objects as $object) {
            $matches = true;

            foreach ($criteria as $key => $value) {
                if ($object[$key] === $value) {
                    continue;
                }

                $matches = false;
            }

            if (! $matches) {
                continue;
            }

            $objects[] = $object;
        }

        return $objects;
    }
1199728
protected static function parseCriteria(array $criteria): array
    {
        $columns = [];
        $values = [];
        $options = ['order' => 'name'];

        // Find by source
        if ($criteria['source']) {
            $columns[] = 'source=?';
            $values[] = $criteria['source'];
        }

        // Find by alias
        if ($criteria['alias']) {
            $columns[] = 'alias=?';
            $values[] = $criteria['alias'];
        }

        // Find only the used tags
        if ($criteria['usedOnly']) {
            $ids = \Haste\Model\Model::getRelatedValues($criteria['sourceTable'], $criteria['sourceField']);

            if (\count($ids) < 1) {
                throw new NoTagsException();
            }

            $columns[] = 'id IN ('.\implode(',', \array_map('intval', \array_unique($ids))).')';
        }

        // Find the tags by values/IDs
        if (\is_array($criteria['values'])) {
            if (\count($criteria['values']) < 1) {
                throw new NoTagsException();
            }

            $columns[] = 'id IN ('.\implode(',', \array_map('intval', $criteria['values'])).')';
        }

        // Find the tags by aliases
        if (\is_array($criteria['aliases'])) {
            if (\count($criteria['aliases']) < 1) {
                throw new NoTagsException();
            }

            $columns[] = "alias IN ('".\implode("','", $criteria['values'])."')'";
        }

        return [$columns, $values, $options];
    }
762768
protected function loadRows(IRowCriteria $criteria = null) : array
    {
        $objectSource = $this->objectSource;

        $objects          = null;
        $objectProperties = null;
        $definition       = $this->definition;

        if ($criteria) {
            $mappedCriteria = $this->criteriaMapper->mapCriteria($criteria);
            $objects        = $objectSource->matching($mappedCriteria);
        } else {
            $objects = $objectSource->getAll();
        }

        if ($objectProperties === null) {
            $objectProperties = $this->loadObjectProperties($objects);
        }

        return $this->mapObjectsToRows($definition, $objectProperties, $objects, $criteria);
    }
176697
public function findOneBy(array $criteria)
    {
        $elements = $this->findBy($criteria);
        return !empty($elements) ? reset($elements) : null;
    }
292992
public function addCriteria(Criteria $criteria)
    {
        $allAliases = $this->getAllAliases();
        if (! isset($allAliases[0])) {
            throw new Query\QueryException('No aliases are set before invoking addCriteria().');
        }

        $visitor         = new QueryExpressionVisitor($this->getAllAliases());
        $whereExpression = $criteria->getWhereExpression();

        if ($whereExpression) {
            $this->andWhere($visitor->dispatch($whereExpression));
            foreach ($visitor->getParameters() as $parameter) {
                $this->parameters->add($parameter);
            }
        }

        if ($criteria->getOrderings()) {
            foreach ($criteria->getOrderings() as $sort => $order) {
                $hasValidAlias = false;
                foreach ($allAliases as $alias) {
                    if (strpos($sort . '.', $alias . '.') === 0) {
                        $hasValidAlias = true;
                        break;
                    }
                }

                if (! $hasValidAlias) {
                    $sort = $allAliases[0] . '.' . $sort;
                }

                $this->addOrderBy($sort, $order);
            }
        }

        $firstResult = $criteria->getFirstResult();
        $maxResults  = $criteria->getMaxResults();

        // Overwrite limits only if they was set in criteria
        if ($firstResult !== null) {
            $this->setFirstResult($firstResult);
        }
        if ($maxResults !== null) {
            $this->setMaxResults($maxResults);
        }

        return $this;
    }
678039
public function findOneBy(array $criteria)
    {
        $query = $this->createQueryBuilder($criteria);
        if (!($object = $this->getOneOrNullResultFromQueryBuilder($query))) {
            $this->throwException('The resource was not found', 'not-found');
        }
        return $object;
    }
1274783
public function createQuery(array $criteria = array())
    {
        $class = $this->documentClass.'Query';
        $query = new $class($this);
        $query->criteria($criteria);

        return $query;
    }
110361
public function registerCriteriaFunction($criteria) {

        $id = \uniqid('criteria');

        if (\is_callable($criteria)) {
           $this->document_criterias[$id] = $criteria;
           return $id;
        }

        if (is_array($criteria)) {

            $fn = null;

            eval('$fn = function($document) { return '.UtilArrayQuery::buildCondition($criteria).'; };');

            $this->document_criterias[$id] = $fn;

            return $id;
        }

        return null;
    }
268339
public function loadAll(array $criteria = [], ?array $sort = null, ?int $limit = null, ?int $skip = null) : Iterator
    {
        $criteria = $this->prepareQueryOrNewObj($criteria);
        $criteria = $this->addDiscriminatorToPreparedQuery($criteria);
        $criteria = $this->addFilterToPreparedQuery($criteria);

        $options = [];
        if ($sort !== null) {
            $options['sort'] = $this->prepareSort($sort);
        }

        if ($limit !== null) {
            $options['limit'] = $limit;
        }

        if ($skip !== null) {
            $options['skip'] = $skip;
        }

        assert($this->collection instanceof Collection);
        $baseCursor = $this->collection->find($criteria, $options);
        return $this->wrapCursor($baseCursor);
    }
1358726
public function findOne(array $criteria = [])
    {
        $result = $this->search($criteria);

        if (count($result) > 0) {
            return $result[0];
        }

        return null;
    }
1083928
public function matching(Criteria $criteria)
    {
        $clause = [];
        /** @var Comparison $whereClause */
        $whereClause = $criteria->getWhereExpression();
        if (null !== $whereClause) {
            if (Comparison::EQ !== $whereClause->getOperator()) {
                throw new \InvalidArgumentException(sprintf('Support for Selectable is limited to the EQUALS "=" operator, 
                 % given', $whereClause->getOperator()));
            }

            $clause = [$whereClause->getField() => $whereClause->getValue()->getValue()];
        }

        return $this->findBy($clause, $criteria->getOrderings(), $criteria->getMaxResults(), $criteria->getFirstResult());
    }
807488
protected function buildQueryBuilder(array $criteria, array $orderBy, $collection = false)
    {
        $queryBuilder = $collection ? $this->createQueryBuilderForCollection() : $this->createQueryBuilder();

        $this->applyCriteria($queryBuilder, $criteria);
        $this->applySorting($queryBuilder, $orderBy);

        return $queryBuilder;
    }