Sets the primary Criteria for this secondary Criteria

@param ModelCriteria $criteria     The primary criteria
@param Join          $previousJoin The previousJoin for this ModelCriteria
427067
public function setPrimaryCriteria(ModelCriteria $criteria, Join $previousJoin)
    {
        $this->primaryCriteria = $criteria;
        $this->setPreviousJoin($previousJoin);
    }
1314664
@Deprecated
    protected void prepareCriteria(Criteria criteria) {
        if (cacheQueries) {
            criteria.setCacheable(true);
        }
        if (shouldPassReadOnlyToHibernate()) {
            criteria.setReadOnly(true);
        }
        SessionHolder sessionHolder = (SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory);
        if (sessionHolder != null && sessionHolder.hasTimeout()) {
            criteria.setTimeout(sessionHolder.getTimeToLiveInSeconds());
        }
    }
18733
public function _mergeWithPrevious($previous)
    {
        if (!$previous)
        {
            return $this;
        }
        if ($previous instanceof DeleteOperation)
        {
            return new SetOperation($this->objects);
        }
        if ($previous instanceof SetOperation)
        {
            $oldValue = $previous->getValue();
            $result = $this->_apply($oldValue, null, null);

            return new SetOperation($result);
        }
        if ($previous instanceof AddUniqueOperation)
        {
            $oldList = $previous->getValue();
            $result = $this->_apply($oldList, null, null);

            return new AddUniqueOperation($result);
        }
        throw new AVException('Operation is invalid after previous operation.');
    }
474393
private function setJoin($table, $field, $parentField, $alias, $parentAlias)
    {
        if (!in_array($alias, $this->tables)) {
            $condition = $this->getFullFieldName($field, $alias).' = '.$this->getFullFieldName($parentField, $parentAlias);
            $this->queryBuilder->join($table, $alias, 'WITH', $condition);
            $this->tables[] = $alias;
        }
    }
264278
public function innerJoin($join, $on = null)
    {
        $this->getJoins()->innerJoin($join, $on);

        return $this;
    }
927055
protected function translateJoin(JoinClause $join, Schema &$schema) {
		$expr = $join->getJoinType() . ' ';
		
		//build condition expression
		$condition = $join->getCondition();
		if ($condition instanceof SQLPredicate)
			$condition = $condition->evaluate($this->driver, $schema);
		elseif (!is_string($condition))
			throw new \InvalidArgumentException("Conditions must be specified either by a SQLPredicate instance or a non-empty string");

		//build join expression
		if ($join->getAlias())
			$expr .= '@@' . $join->getTable() . ' ' . $join->getAlias() . ' ON ' . $condition . ' ';
		else
			$expr .= '@@' . $join->getTable() .  ' ON ' . $condition . ' ';
	
		return $expr;
	}
713947
public function addJoin($join)
    {
        if (null === $join)
            return $this;
        if (!isset($this->query['join'])) {
            $this->query['join'] = [];
        }
        $this->query['join'][] = $join;
        return $this;
    }
853454
private static function getExistingJoin(QueryBuilder $queryBuilder, string $alias, string $association, string $originAlias = null): ?Join
    {
        $parts = $queryBuilder->getDQLPart('join');
        $rootAlias = $originAlias ?? $queryBuilder->getRootAliases()[0];

        if (!isset($parts[$rootAlias])) {
            return null;
        }

        foreach ($parts[$rootAlias] as $join) {
            /** @var Join $join */
            if (sprintf('%s.%s', $alias, $association) === $join->getJoin()) {
                return $join;
            }
        }

        return null;
    }
1052491
protected function setJoin(Builder $query = null)
    {
        $query = $query ?: $this->query;

        $foreignKey = $this->related->getTable().'.'.$this->secondKey;

        $query->join($this->parent->getTable(), $this->getQualifiedParentKeyName(), '=', $foreignKey);
    }
517775
public function innerJoin($mixed, $criteria, $alias='')
    {
        if(is_string($mixed) && strpos($mixed, " ") !== false) {
            throw new \InvalidArgumentException(
                "Invalid table name '$mixed'. Possibly use alias parameter instead?");
        }

        return $this->_join('INNER JOIN', $mixed, $criteria, $alias);
    }
231097
public function setJoin($name, $cond, $cols = Zend_Db_Select::SQL_WILDCARD, $schema = null)
	{
		debug_assert(false);
		return $this;
	}
373424
public function where($column, $value = '', $operator = Criterion::EQUALS, $variable = null, $additional = null, $special = null): Criteria
        {
            if (!$column instanceof Criteria) {
                $criteria = new Criteria();
                $criteria->where($column, $value, $operator, $variable, $additional, $special);
                $column = $criteria;
            }

            $column->setQuery($this);
            $this->criteria[] = $column;

            return $column;
        }
846064
public function criteria(Criteria\Criteria $cri = null)
    {
        if (! $cri) $cri = new Criteria\Criteria($this);
        $cri->setTable($this);

        return $cri;
    }
1119345
protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = [])
    {
        foreach ($criteria as $property => $value) {
            $name = $this->getPropertyName($property);
            if (null === $value) {
                $queryBuilder->andWhere($queryBuilder->expr()->isNull($name));
            } elseif (is_array($value)) {
                $queryBuilder->andWhere($queryBuilder->expr()->in($name, $value));
            } elseif ('' !== $value) {
                $parameter = str_replace('.', '_', $property);
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->eq($name, ':'.$parameter))
                    ->setParameter($parameter, $value)
                ;
            }
        }
    }
142473
private function applyJoins(ClassMetadata $metadata, array $joins, string $alias): void
    {
        foreach ($joins as $field => $join) {
            $joinedAlias = $this->createJoin($alias, $field, $join['type']);

            if (isset($join['joins']) || isset($join['conditions'])) {
                $targetClassName = $metadata->getAssociationMapping($field)['targetEntity'];
                $targetMetadata = $this->entityManager->getClassMetadata($targetClassName);
                $type = $this->types->getFilterGroupCondition($targetClassName);
                $this->applyJoinsAndFilters($targetMetadata, $joinedAlias, $type, $join['joins'] ?? [], $join['conditions'] ?? []);
            }
        }
    }
643323
protected function setUpdateCriteria(
        Sql\SqlInterface $query, $primaryKey, $table
    ) {
        $key = "{$table}.{$primaryKey} = :id";
        $query->where([$key => [':id' => $this->entity->{$primaryKey}]]);
        return $query;
    }
856680
protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = null)
    {
        if (null === $criteria) {
            return;
        }

        foreach ($criteria as $property => $value) {
            if (null === $value) {
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->isNull($this->getPropertyName($property)));
            } elseif (!is_array($value)) {
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->eq($this->getPropertyName($property), ':' . $property))
                    ->setParameter($property, $value);
            } else {
                $queryBuilder->andWhere($queryBuilder->expr()->in($this->getPropertyName($property), $value));
            }
        }
    }