Creates a join phrase in a compiled query

@param string $table
@param string $condition
@param string $type
@return QueryBuilderInterface
979168
public function join(string $table, string $condition, string $type=''): QueryBuilderInterface
	{
		// Prefix and quote table name
		$table = explode(' ', mb_trim($table));
		$table[0] = $this->driver->quoteTable($table[0]);
		$table = $this->driver->quoteIdent($table);
		$table = implode(' ', $table);

		// Parse out the join condition
		$parsedCondition = $this->parser->compileJoin($condition);
		$condition = $table . ' ON ' . $parsedCondition;

		$this->state->appendMap("\n" . strtoupper($type) . ' JOIN ', $condition, 'join');

		return $this;
	}
651144
public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)
    {
        $join = new JoinClause($this, $type, $table);

        // If the first "column" of the join is really a Closure instance the developer
        // is trying to build a join with a complex "on" clause containing more than
        // one condition, so we'll add the join and call a Closure with the query.
        if ($one instanceof Closure) {
            call_user_func($one, $join);

            $this->joins[] = $join;

            $this->addBinding($join->getBindings(), 'join');
        } // If the column is simply a string, we can assume the join simply has a basic
        // "on" clause with a single condition. So we will just build the join with
        // this simple join clauses attached to it. There is not a join callback.
        else {
            $method = $where ? 'where' : 'on';

            $this->joins[] = $join->$method($one, $operator, $two);

            $this->addBinding($join->getBindings(), 'join');
        }

        return $this;
    }
764209
function LeftJoin(Table $table, Condition $condition, $prepend = false)
    {
        return $this->Join($table, JoinType::Left(), $condition, $prepend);
    }
458457
public function join($table, $joinType=MYSQL_JOIN_LEFT) {
        $this->sqlBuilder->join($table, $joinType);
        return $this;
    }
929226
protected function getJoinClause(Model $parent, Relation $relation, $table, $type)
    {
        list($fk, $pk) = $this->getJoinKeys($relation);

        $join = (new Join($this->query, $type, $table))->on($fk, '=', $pk);

        if (in_array(SoftDeletes::class, class_uses_recursive($relation->getRelated()))) {
            $join->whereNull($relation->getRelated()->getQualifiedDeletedAtColumn());
        }

        if ($relation instanceof MorphOneOrMany) {
            $join->where($relation->getQualifiedMorphType(), '=', $parent->getMorphClass());
        } elseif ($relation instanceof MorphToMany || $relation instanceof MorphByMany) {
            $join->where($relation->getMorphType(), '=', $parent->getMorphClass());
        }

        return $join;
    }
893868
public function Join(string $table, string $as, string $by, string $condition): QueryBuilder
    {
        $this->join[] = [
            'table' => $table,
            'as' => $as,
            'by' => $by,
            'cond' => $condition
        ];
        
        return $this;
    }
757419
protected function getSelectJoinColumnSQL($tableAlias, $joinColumnName, $className, $type)
    {
        $columnAlias = $this->getSQLColumnAlias($joinColumnName);

        $this->currentPersisterContext->rsm->addMetaResult('r', $columnAlias, $joinColumnName, false, $type);

        return $tableAlias . '.' . $joinColumnName . ' AS ' . $columnAlias;
    }
1301743
public function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false)
	{
		$join = new JoinClause($this, $type, $table);

		// If the first "column" of the join is really a Closure instance the developer
		// is trying to build a join with a complex "on" clause containing more than
		// one condition, so we'll add the join and call a Closure with the query.
		if ($first instanceof Closure)
		{
			call_user_func($first, $join);
			$this->joins[] = $join;
			$this->addBinding($join->getBindings(), 'join');
		}

		// If the column is simply a string, we can assume the join simply has a basic
		// "on" clause with a single condition. So we will just build the join with
		// this simple join clauses attached to it. There is not a join callback.
		else
		{
			$method = $where ? 'where' : 'on';
			$this->joins[] = $join->$method($first, $operator, $second);
			$this->addBinding($join->getBindings(), 'join');
		}

		return $this;
	}
482700
protected function aggregate(ConditionInterface $condition)
    {
        if (!$condition->getParameters()) {
            return '';
        }

        $this->aggNumber++;
        $prefix = str_repeat('_', $this->aggNumber);
        $qb = $this->cloneQb($this->queryBuilder);

        $this->resetSqlParts($qb)
            ->select(sprintf('DISTINCT %s%s', $prefix, $this->aliasDotPrimary()))
            ->addGroupBy(sprintf('%s%s', $prefix, $this->aliasDotPrimary()));
        /** @var From $fromPart */
        foreach ($this->getSqlPart($this->queryBuilder, 'from') as $fromPart) {
            /** @var Base $newFrom */
            $newFrom = new From($fromPart->getFrom(), $prefix.$fromPart->getAlias());
            $qb->add('from', $newFrom, true);
        }
        foreach ($this->getSqlPart($this->queryBuilder, 'join') as $rootAlias => $joinPart) {
            /** @var Join $subPart */
            foreach ($joinPart as $subPart) {
                $join = new Join(
                    $subPart->getJoinType(),
                    $prefix.$subPart->getJoin(),
                    $prefix.$subPart->getAlias()
                );
                /** @var Base $newJoin */
                $newJoin = [$prefix.$rootAlias => $join];
                $qb->add('join', $newJoin, true);
            }
        }

        $newParameters = [];
        foreach ($condition->getParameters() as $paramName => $paramValue) {
            $newParameters[str_replace(':', ':'.$prefix, $paramName)] = $paramValue;
        }

        if (count($newParameters) === 2 && stripos($condition->getComparisonOperator(), Condition::BETWEEN) !== false) {
            $newParameterName = implode(' AND ', array_keys($newParameters));
        } else {
            $newParameterName = key($newParameters);
        }

        $qb->andHaving($condition->getSqlFunctionDefinition($newParameterName, $prefix))->setParameters([]);

        foreach ($newParameters as $paramName => $paramValue) {
            $parameter = new Parameter($paramName, $paramValue);
            $this->parameters->add($parameter);
        }

        return sprintf('%s IN(%s)', $this->aliasDotPrimary(), $qb->getDQL());
    }
167040
public function join(string $table, array $on, string $type = "INNER")
    {
        if (count($on) > 2) {
            throw new PhiberException("error_on_join");
        }

        try {
            switch (strtoupper($type)) {
                case "INNER":
                    return ["join" => "INNER JOIN " . $table . " ON " . $on[0] . " = " . $on[1]];
                    break;

                case "LEFT":
                    return ["join" => "LEFT JOIN " . $table . " ON " . $on[0] . " = " . $on[1]];
                    break;

                case "RIGHT":
                    return ["join" => "RIGHT JOIN " . $table . " ON " . $on[0] . " = " . $on[1]];
                    break;

                case "FULL OUTER":
                    return ["join" => "FULL OUTER JOIN " . $table . " ON " . $on[0] . " = " . $on[1]];
                    break;

                default:
                    return ["join" => "INNER JOIN " . $table . " ON " . $on[0] . " = " . $on[1]];
            }

        } catch (PhiberException $phiberException) {
            throw new PhiberException("join_no_exists");
        }
    }
991959
public function join($table, $criteria = null, $type = self::INNER_JOIN, $alias = null)
    {
        if (!$this->isJoinUnique($table, $alias)) {
            return $this;
        }

        if (is_string($criteria)) {
            $criteria = array($criteria);
        }

        $this->join[] = array('table' => $table,
            'criteria' => $criteria,
            'type' => $type,
            'alias' => $alias);

        return $this;
    }
49430
function _makeJoiner (type) {
	return function (clause, options) {
		if (isQueryizeObject(clause)) {
			if (typeof options !== 'object') throw new Error('You must define join options when joining against a queryize subquery.');

			options = Object.create(options);
			options.table = clause;
			clause = options;
		} else if (typeof clause === 'object') {
			if (isArray(clause)) throw new TypeError('Join clauses can only be strings or object definitions');
			if (!clause.table) throw new Error('You must define a table to join against');
		} else if (typeof options === 'object') {
			options = Object.create(options);
			options.table = clause;
			clause = options;
		}

		if (typeof clause === 'object') {
			clause.type = type;
		} else {
			clause = clause.search(joinTest) > -1 ? clause.replace(joinTest, type + ' JOIN ') : type + ' JOIN ' + clause;
		}

		this.join(clause);

		return this;
	};
}
931468
public function addJoin($join_field, $alias, $type = Join::INNER_JOIN, $cond = '')
    {
        $this->_queryBuilder->addJoin($join_field, $alias, $type, $cond);
        return $this;
    }
1064585
public function join($table, $on, $type = QueryBuilder::LEFT) {
        $table          = self::parseAs($table);
        $join           = [$table [0], $on, $type . ' JOIN ', $table [1]];
        $this->joins [] = $join;

        return $this;
    }
757645
protected function _addJoin($type, $table, $fields, $on = []) {
        $repo = $this->getRepository();
        $join = new Join($type);
        $conditions = [];

        if (is_array($table)) {
            $alias = $table[1];
            $table = $table[0];
        } else {
            $alias = $table;
        }

        foreach ($on as $pfk => $rfk) {
            if (strpos($pfk, '.') === false) {
                $pfk = $repo->getAlias() . '.' . $pfk;
            }

            if (strpos($rfk, '.') === false) {
                $rfk = $alias . '.' . $rfk;
            }

            $conditions[$pfk] = $rfk;
        }

        $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);

        return $this;
    }
463872
public function join($table, $condition = null, $alias = null, $type = null)
    {
        if (strpos($condition, '[') === false && strpos($condition, '(') === false) {
            $condition = (string)preg_replace('#\w+#', '[\\0]', $condition);
        }

        if (is_string($table) && strpos($table, '\\') !== false) {
            /** @var \ManaPHP\Model $model */
            $model = $this->_di->getShared($table);
            $table = $model->getSource($this->_bind);
        }

        $this->_joins[] = [$table, $condition, $alias, $type];

        return $this;
    }
543201
public function newConditionCreateStruct(string $type): ConditionCreateStruct
    {
        $struct = new ConditionCreateStruct();
        $struct->type = $type;

        return $struct;
    }