Join table

@param string $table
@param mixed $condition
@param int $joinType
@return \pwf\components\querybuilder\interfaces\SelectBuilder
961581
public function join($table, $condition, $joinType = self::JOIN_LEFT)
    {
        $this->join[] = [
            'table' => $table,
            'condition' => $condition,
            'jointType' => $joinType
        ];
        return $this;
    }
1301718
public function rightJoin($table) {
        JoinImpl::join($this->context,'RIGHT', $table);
        return new JoinOnRule($this->context);
    }
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;
    }
966469
private function setManyToManyJoin($table, $alias, $condition = null)
    {
        if (!in_array($alias, $this->tables)) {
            if ($condition) {
                $this->queryBuilder->join($table, $alias, 'WITH', $condition);
            } else {
                $this->queryBuilder->join($table, $alias);
            }
            $this->tables[] = $alias;
        }
    }
315896
public function join($type, $table, $where, $using = true)
    {
        $linkage = $using ? 'USING ('.$where.')' : ' ON ('.$where.')';
        $this->joins[] = $type.' JOIN ' . $table . ' ' . $linkage;
        
        return $this;
    }
631816
public QueryBuilder<T, ID> join(QueryBuilder<?, ?> joinedQueryBuilder, JoinType type, JoinWhereOperation operation)
			throws SQLException {
		addJoinInfo(type, null, null, joinedQueryBuilder, operation);
		return this;
	}
1243625
public function join($joinType, $tableName = '', $on = [], $alias = '')
    {
        if (is_string($joinType) && empty($tableName)) {
            $this->sqlParts['join'][] = $this->getAdapter()->quoteSql($joinType);
        } elseif ($tableName instanceof self) {
            $this->sqlParts['join'][] = $this->sqlJoin($joinType, $tableName, $on, $alias);
        } else {
            $this->sqlParts['join'][$tableName] = $this->sqlJoin($joinType, $tableName, $on, $alias);

            $this->_joinAlias[$tableName] = $alias;
        }

        return $this;
    }
145070
public function getConditionSql(array $sql, array $where, string $conditionType): array
    {
        if (empty($where)) {
            return $sql;
        }
        foreach ($where as $index => $item) {
            if ($item instanceof RawExp) {
                if ($index == 0) {
                    $sql[] = $conditionType . ' ' . $item->getValue();
                    continue;
                }
                $sql[] = $item->getValue();
                continue;
            }
            [$type, $conditions] = $item;
            if (!$index) {
                $whereType = $conditionType;
            } else {
                $whereType = strtoupper($type);
            }
            if ($conditions[0] instanceof RawExp) {
                $sql[] = $whereType . ' ' . $conditions[0]->getValue();
                continue;
            }
            [$leftField, $operator, $rightField] = $conditions;
            $leftField = $this->quoter->quoteName($leftField);
            [$rightField, $operator] = $this->getRightFieldValue($rightField, $operator);

            $sql[] = sprintf('%s %s %s %s', $whereType, $leftField, $operator, $rightField);
        }

        return $sql;
    }
907580
public function leftJoin(string $tableName, string $tableAlias, string $condition) : self
    {
        $this->joins['left'][] = ['tableName' => $tableName, 'tableAlias' => $tableAlias, 'condition' => $condition];

        return $this;
    }
1082964
protected function anyJoin($type, $table, $conditions = '', $params = array())
    {
        $this->mergeParams($params);
        if ($alias = $this->matchAlias($table)) {
            $table = $this->db->quoteTable($alias[0]) . ' AS ' . $this->db->quoteTable($alias[1]);
        } else {
            $table = $this->db->quoteTable($table);
        }
        $conditions = $this->buildConditions($conditions);
        if ('' !== $conditions) {
            $conditions = ' ON ' . $conditions;
        }

        if (isset($this->query['join']) && is_string($this->query['join'])) {
            $this->query['join'] = array($this->query['join']);
        }

        $this->query['join'][] = $type . ' ' . $table . ' ' . $conditions;

        return $this;
    }
1298260
protected function makeConditions($type, $join = 'AND')
    {
        $conditionHolder = "{$type}Conditions";

        // If there are no clauses, return empty string
        if (count($this->$conditionHolder) === 0) {
            return '';
        }

        $conditions = [];

        /*
         * Bind all values to property to execute query
         */
        foreach ($this->$conditionHolder as $condition) {
            $conditions[] = $condition[0];
            $this->bindings = array_merge($this->bindings, $condition[1]);
        }

        return strtoupper($type).' '.implode(" $join ", $conditions);
    }
1265109
public function join($table, $on = null, $where = null, $binds = [], $type = 'LEFT')
    {
        if ($table instanceof Relation) {
            if (is_only_callable($on)) {
                /**
                 * Is this needed?
                 */
                Reflect::call($on, [$table, $table->getQuery()]);
            }

            $table->mergeToQuery($this->getQuery());
        } elseif ($table instanceof Entity) {
            $query = $table->getQuery();

            $sql = $query->buildSQL();

            $this->getQuery()->join(
                $type . ' JOIN (' . $sql . ') AS `' . $where . '` ON (' .
                (strpos($on, '(') ? '' : ($where . '.')) . $on . ')',
                null,
                null,
                $query->buildBinds()
            );
        } else {
            $this->getQuery()->join($table, $on, $where, $binds);
        }

        return $this;
    }
543138
function Join(Table $table, JoinType $join, Condition $condition, $prepend = false)
    {
        $result = $this->Duplicate();
        if ($prepend)
        {
            array_unshift($result->tables, $table);
            array_unshift($result->joins, $join);
            array_unshift($result->conditions, $condition);
        }
        else
        {    
            $result->tables[] = $table;
            $result->joins[] = $join;
            $result->conditions[] = $condition;
        }
        return $result;
    }
20357
public function join($type, $table, $conditions=null, $recursive=true) {
		if($recursive && is_array($table)) {
			foreach($table as $_table=>$_conditions) {
				if($_conditions instanceof static)
					$this->join($type, $table, $conditions, false);
				elseif($_conditions instanceof Raw)
					$this->join($type, $table, $conditions, false);
				else
					$this->join($type, $_table, $_conditions);
			}

			return $this;
		}

		#for tables that are static or Raw
		if(is_array($table)) {
			$alias = array_keys($table)[0];
			$table = array_values($table)[0];
		}
		else {
			$table_alias = explode(' ', $table);
			$table = $table_alias[0];
			if(isset($table_alias[1]))
				$alias = $table_alias[1];
			else
				$alias = $table;
		}

		$this->joins[$alias] = [$type, $table, $conditions];

		return $this;
	}
558878
function RightJoin(Table $table, Condition $condition, $prepend = false)
    {
        return $this->Join($table, JoinType::Right(), $condition, $prepend);
    }
422274
public function where($condition, $value = null, $type = null)
    {

        switch ($type) {
            case null:
                $clause = 'WHERE';
                break;
            case 'or':
                $clause = 'OR';
                break;
            case 'and':
                $clause = 'AND';
                break;
            default:
                $clause = 'WHERE';
        }

        $this->oosql_where .= " $clause $condition";

        if ($value instanceof oosql) {

            $this->oosql_where .= $value->getSql();
        } elseif (null !== $value) {

            $this->oosql_conValues[] = $value;
        }

        return $this;
    }
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;
    }