PHP Class NilPortugues\Sql\QueryBuilder\Manipulation\Select

Inheritance: extends NilPortugues\Sql\QueryBuilder\Manipulation\AbstractBaseQuery
Exibir arquivo Open project: nilportugues/sql-query-builder Class Usage Examples

Protected Properties

Property Type Description
$camelCaseTableName string
$columnQuery NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery
$groupBy array
$having NilPortugues\Sql\QueryBuilder\Syntax\Where
$havingOperator string
$isDistinct boolean
$joinQuery JoinQuery
$parentQuery ParentQuery
$table NilPortugues\Sql\QueryBuilder\Syntax\Table
$where NilPortugues\Sql\QueryBuilder\Syntax\Where

Public Methods

Method Description
__clone ( ) : Select This __clone method will create an exact clone but without the object references due to the fact these are lost in the process of serialization and un-serialization.
__construct ( string $table = null, array $columns = null )
addJoin ( Select $select, string $selfColumn, string $refColumn ) : Select
count ( string $columnName = '*', string $alias = '' ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery
crossJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
distinct ( )
getAllColumns ( ) : array
getAllHavings ( ) : array
getAllJoins ( ) : array
getAllOrderBy ( ) : array
getAllWheres ( ) : array Returns all the Where conditions to the BuilderInterface class in order to write the SQL WHERE statement.
getColumnFuncs ( ) : array
getColumnSelects ( ) : array
getColumnValues ( ) : array
getColumns ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Column
getGroupBy ( ) : array
getHavingOperator ( ) : string
getJoinCondition ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Where
getJoinType ( ) : string
getParentQuery ( ) : ParentQuery
groupBy ( array $columns )
having ( $havingOperator = 'AND' ) : NilPortugues\Sql\QueryBuilder\Syntax\Where
innerJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
isCount ( ) : boolean
isDistinct ( ) : boolean
isJoin ( boolean $isJoin = true ) : JoinQuery Transforms Select in a joint.
isJoinSelect ( ) : boolean
join ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [], string $joinType = null ) : Select
joinCondition ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Where WHERE constrains used for the ON clause of a (LEFT/RIGHT/INNER/CROSS) JOIN.
leftJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
limit ( integer $start, $count )
on ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Where Alias to joinCondition.
orderBy ( string $column, string $direction = OrderBy::ASC, null $table = null )
partName ( ) : string
rightJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
setColumns ( array $columns ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery Sets the column names used to write the SELECT statement.
setFunctionAsColumn ( string $funcName, array $arguments, string $alias ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery Allows calculation on columns using predefined SQL functions.
setJoinType ( string | null $joinType )
setParentQuery ( Select $parentQuery )
setSelectAsColumn ( array $column ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery Allows setting a Select query as a column value.
setValueAsColumn ( string $value, string $alias ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery Allows setting a value to the select statement.

Protected Methods

Method Description
getAllOperation ( null | NilPortugues\Sql\QueryBuilder\Syntax\Where $data, string $operation ) : array

Method Details

__clone() public method

This __clone method will create an exact clone but without the object references due to the fact these are lost in the process of serialization and un-serialization.
public __clone ( ) : Select
return Select

__construct() public method

public __construct ( string $table = null, array $columns = null )
$table string
$columns array

addJoin() public method

public addJoin ( Select $select, string $selfColumn, string $refColumn ) : Select
$select Select
$selfColumn string
$refColumn string
return Select

count() public method

public count ( string $columnName = '*', string $alias = '' ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery
$columnName string
$alias string
return NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery

crossJoin() public method

public crossJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
$table string
$selfColumn string
$refColumn string
$columns string[]
return Select

distinct() public method

public distinct ( )

getAllColumns() public method

public getAllColumns ( ) : array
return array

getAllHavings() public method

public getAllHavings ( ) : array
return array

getAllJoins() public method

public getAllJoins ( ) : array
return array

getAllOperation() protected method

protected getAllOperation ( null | NilPortugues\Sql\QueryBuilder\Syntax\Where $data, string $operation ) : array
$data null | NilPortugues\Sql\QueryBuilder\Syntax\Where
$operation string
return array

getAllOrderBy() public method

public getAllOrderBy ( ) : array
return array

getAllWheres() public method

Returns all the Where conditions to the BuilderInterface class in order to write the SQL WHERE statement.
public getAllWheres ( ) : array
return array

getColumnFuncs() public method

public getColumnFuncs ( ) : array
return array

getColumnSelects() public method

public getColumnSelects ( ) : array
return array

getColumnValues() public method

public getColumnValues ( ) : array
return array

getColumns() public method

public getColumns ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Column
return NilPortugues\Sql\QueryBuilder\Syntax\Column

getGroupBy() public method

public getGroupBy ( ) : array
return array

getHavingOperator() public method

public getHavingOperator ( ) : string
return string

getJoinCondition() public method

public getJoinCondition ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Where
return NilPortugues\Sql\QueryBuilder\Syntax\Where

getJoinType() public method

public getJoinType ( ) : string
return string

getParentQuery() public method

public getParentQuery ( ) : ParentQuery
return ParentQuery

groupBy() public method

public groupBy ( array $columns )
$columns array

having() public method

public having ( $havingOperator = 'AND' ) : NilPortugues\Sql\QueryBuilder\Syntax\Where
$havingOperator
return NilPortugues\Sql\QueryBuilder\Syntax\Where

innerJoin() public method

public innerJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
$table string
$selfColumn string
$refColumn string
$columns string[]
return Select

isCount() public method

public isCount ( ) : boolean
return boolean

isDistinct() public method

public isDistinct ( ) : boolean
return boolean

isJoin() public method

Transforms Select in a joint.
public isJoin ( boolean $isJoin = true ) : JoinQuery
$isJoin boolean
return JoinQuery

isJoinSelect() public method

public isJoinSelect ( ) : boolean
return boolean

join() public method

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
return Select

joinCondition() public method

WHERE constrains used for the ON clause of a (LEFT/RIGHT/INNER/CROSS) JOIN.
public joinCondition ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Where
return NilPortugues\Sql\QueryBuilder\Syntax\Where

leftJoin() public method

public leftJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
$table string
$selfColumn string
$refColumn string
$columns string[]
return Select

limit() public method

public limit ( integer $start, $count )
$start integer
$count

on() public method

Alias to joinCondition.
public on ( ) : NilPortugues\Sql\QueryBuilder\Syntax\Where
return NilPortugues\Sql\QueryBuilder\Syntax\Where

orderBy() public method

public orderBy ( string $column, string $direction = OrderBy::ASC, null $table = null )
$column string
$direction string
$table null

partName() public method

public partName ( ) : string
return string

rightJoin() public method

public rightJoin ( string $table, string $selfColumn = null, string $refColumn = null, string[] $columns = [] ) : Select
$table string
$selfColumn string
$refColumn string
$columns string[]
return Select

setColumns() public method

If key is set, key is the column's alias. Value is always the column names.
public setColumns ( array $columns ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery
$columns array
return NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery

setFunctionAsColumn() public method

Allows calculation on columns using predefined SQL functions.
public setFunctionAsColumn ( string $funcName, array $arguments, string $alias ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery
$funcName string
$arguments array
$alias string
return NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery

setJoinType() public method

public setJoinType ( string | null $joinType )
$joinType string | null

setParentQuery() public method

public setParentQuery ( Select $parentQuery )
$parentQuery Select

setSelectAsColumn() public method

Allows setting a Select query as a column value.
public setSelectAsColumn ( array $column ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery
$column array
return NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery

setValueAsColumn() public method

Allows setting a value to the select statement.
public setValueAsColumn ( string $value, string $alias ) : NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery
$value string
$alias string
return NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery

Property Details

$camelCaseTableName protected_oe property

protected string $camelCaseTableName
return string

$columnQuery protected_oe property

protected ColumnQuery,NilPortugues\Sql\QueryBuilder\Manipulation $columnQuery
return NilPortugues\Sql\QueryBuilder\Manipulation\ColumnQuery

$groupBy protected_oe property

protected array $groupBy
return array

$having protected_oe property

protected Where,NilPortugues\Sql\QueryBuilder\Syntax $having
return NilPortugues\Sql\QueryBuilder\Syntax\Where

$havingOperator protected_oe property

protected string $havingOperator
return string

$isDistinct protected_oe property

protected bool $isDistinct
return boolean

$joinQuery protected_oe property

protected JoinQuery,NilPortugues\Sql\QueryBuilder\Manipulation $joinQuery
return JoinQuery

$parentQuery protected_oe property

protected ParentQuery $parentQuery
return ParentQuery

$table protected_oe property

protected Table,NilPortugues\Sql\QueryBuilder\Syntax $table
return NilPortugues\Sql\QueryBuilder\Syntax\Table

$where protected_oe property

protected Where,NilPortugues\Sql\QueryBuilder\Syntax $where
return NilPortugues\Sql\QueryBuilder\Syntax\Where