NilPortugues\Sql\QueryBuilder\Manipulation\JoinQuery::join PHP Метод

join() публичный Метод

public join ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [], string $joinType = null ) : Select
$table string
$selfColumn string
$refColumn string
$columns string[]
$joinType string
Результат Select
    public function join($table, $selfColumn = null, $refColumn = null, $columns = [], $joinType = null)
    {
        if (!isset($this->joins[$table])) {
            $select = QueryFactory::createSelect($table);
            $select->setColumns($columns);
            $select->setJoinType($joinType);
            $select->setParentQuery($this->select);
            $this->addJoin($select, $selfColumn, $refColumn);
        }
        return $this->joins[$table];
    }

Usage Example

Пример #1
0
 /**
  * @param string   $table
  * @param string   $selfColumn
  * @param string   $refColumn
  * @param string[] $columns
  * @param string   $joinType
  *
  * @return Select
  */
 public function join($table, $selfColumn = null, $refColumn = null, $columns = array(), $joinType = null)
 {
     return $this->joinQuery->join($table, $selfColumn, $refColumn, $columns, $joinType);
 }