Perform join query.

@param string $table
@param string $foreign
@param string $other
@param string $deletedAt
@param string $type
481557
protected function performJoin($table, $foreign, $other, $deletedAt = false, $type = 'left')
    {
        $joins = [];
        foreach ((array) $this->getBaseQueryBuilder()->joins as $key => $join) {
            $joins[] = $join->table;
        }

        if (! in_array($table, $joins)) {
            $this->getBaseQueryBuilder()->join($table, $foreign, '=', $other, $type);
        }

        if ($deletedAt !== false) {
            $this->getBaseQueryBuilder()->whereNull($deletedAt);
        }
    }
1365949
public function join($table, $constraint, $table_alias = null)
        {
            return $this->_addJoinSource("", $table, $constraint, $table_alias);
        }
1350556
static function TableHasMany($table, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
	{
		$ar = new ADODB_Active_Record($table);
		$ar->hasMany($foreignRef, $foreignKey, $foreignClass);
	}
664683
public function join($table, $key, $operator = null, $value = null, $type = 'inner')
    {
        if (!$key instanceof \Closure) {
            $key = function ($joinBuilder) use ($key, $operator, $value) {
                $joinBuilder->on($key, $operator, $value);
            };
        }

        // Build a new JoinBuilder class, keep it by reference so any changes made
        // in the closure should reflect here
        $joinBuilder = $this->container->build('\\Pixie\\QueryBuilder\\JoinBuilder', array($this->connection));
        $joinBuilder = &$joinBuilder;
        // Call the closure with our new joinBuilder object
        $key($joinBuilder);
        $table = $this->addTablePrefix($table, false);
        // Get the criteria only query from the joinBuilder object
        $this->statements['joins'][] = compact('type', 'table', 'joinBuilder');

        return $this;
    }
553510
public function join($table, $foreignKey1, $operator, $foreignKey2, $relation = "INNER")
    {
        $self               = self::getInstance();
        $self->optionJoin[] = " {$relation} JOIN {$table} ON {$foreignKey1}{$operator}{$foreignKey2}";
        return $self;
    }
1119861
function DropForeignKey($table, $foreignKey)
    {
        $escaper = $this->GetEscaper();
        $query = 'ALTER TABLE ' . $escaper->EscapeIdentifier($table) . 
                ' DROP FOREIGN KEY ' . $escaper->EscapeIdentifier($foreignKey);
        $this->ExecuteQuery($query);
    }
1231556
public function join(string $table, string $one, string $operator = '=', string $two = ''): BaseQueryRelateContract
    {
        $this->query->join($table, $one, $operator, $two);

        return $this;
    }
340023
public function join(
        $foreign_table,
        $master_field = null,
        $join_kind = null,
        $_foreign_alias = null,
        $relation = null
    ) {
        if (!$_foreign_alias) {
            $_foreign_alias = '_'.$foreign_table[0];
        }
        $_foreign_alias = $this->_unique($this->relations, $_foreign_alias);

        /** @type SQL_Relation $rel */
        $rel = $this->add('SQL_Relation', $_foreign_alias);

        return $this->relations[$_foreign_alias] = $rel
            ->set($foreign_table, $master_field, $join_kind, $relation);
    }
1191915
public function join($table, $on, $type = 'full', $alias = '')
    {
        if (!isset($this->joins)) {
            $this->joins = [];
        }
        $join = [
            'table' => $this->trimName($table),
            'on' => $on,
            'type' => $type,
        ];
        if (!empty($alias)) {
            $join['alias'] = $this->trimName($alias);
        }
        $this->joins = array_merge($this->joins, [$join]);
        return $this;
    }
401570
public function join(string $table, string $column, string $toColumn, string $type = Query\JoinType::LEFT)
    {
        $alias = $this->joinCurrentAlias++;

        $toAlias = self::cutAlias($toColumn);

        $this->joins[$alias] = [
            'type'   => $type,
            'table'  => $table,
            'column' => $column,
            'to'     => [$toAlias, $toColumn],
        ];

        return $this;
    }
736525
public function leftJoin($table, $alias_or_cond, $cond = null) {
		if (is_null($cond))
			$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, null, $alias_or_cond);
		else
			$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, $alias_or_cond, $cond);
		return $this;
	}
467458
public function join($table, $on = null, $using = null, $type = 'JOIN')
    {
        $this->from->addJoin($table, $on, $using, $type);

        return $this;
    }
751897
protected function join(
        $type,
        $joinTableName,
        $key,
        $comparator,
        $value = null,
        $shouldCompareFields = true,
        $tableName = null
    ) {
        if (!$tableName) {
            $tableName = $this->getTableName();
        }

        $condition = new \Parable\ORM\Query\Condition();
        $condition
            ->setQuery($this)
            ->setTableName($tableName)
            ->setJoinTableName($joinTableName)
            ->setKey($key)
            ->setComparator($comparator)
            ->setValue($value)
            ->setShouldCompareFields($shouldCompareFields);

        $this->joins[$type][] = $condition;
        return $this;
    }
1204297
public function addJoin($join_field, $alias, $type = Join::INNER_JOIN, $cond = '')
    {
        if ($cond != '')
        {
            $cond = " with {$cond} ";
        }
        $join_method   = $type == Join::INNER_JOIN ? "innerJoin" : "leftJoin";
        $this->queryBuilder->$join_method($join_field, $alias, null, $cond);
        $this->joins[] = array($join_field, $alias, $type, $cond);
        return $this;
    }
321670
public function belongsToMany(
        $entity,
        string $related,
        string $table = null,
        string $foreignKey = null,
        string $otherKey = null
    ): BelongsToMany {
        // Add the relation to the definition in map
        list(, $caller) = debug_backtrace(false);
        $relation = $caller['function'];
        $this->relatedClasses[$relation] = $related;

        $this->addManyRelation($relation);
        $this->addForeignRelation($relation);
        $this->addPivotRelation($relation);

        // First, we'll need to determine the foreign key and "other key" for the
        // relationship. Once we have determined the keys we'll make the query
        // instances as well as the relationship instances we need for this.
        $foreignKey = $foreignKey ?: $this->getForeignKey();

        $relatedMapper = Manager::getInstance()->mapper($related);

        $relatedMap = $relatedMapper->getEntityMap();

        $otherKey = $otherKey ?: $relatedMap->getForeignKey();

        // If no table name was provided, we can guess it by concatenating the two
        // models using underscores in alphabetical order. The two model names
        // are transformed to snake case from their default CamelCase also.
        if (is_null($table)) {
            $table = $this->joiningTable($relatedMap);
        }

        return new BelongsToMany($relatedMapper, $entity, $table, $foreignKey, $otherKey, $relation);
    }
1112135
public function right_outer_join($table, $constraint, $table_alias = null)
        {
            return $this->_addJoinSource("RIGHT OUTER", $table, $constraint, $table_alias);
        }
1346579
public function leftJoin($table, $criteria = null, $alias = null)
    {
        return $this->join($table, $criteria, self::LEFT_JOIN, $alias);
    }