package Default
inherited_from \Zend\Db\Sql\Select

 Methods

__clone

__clone() : void
Inherited

Resets the where object each time the Select is cloned.

Constructor

__construct(null|string|array|\Zend\Db\Sql\TableIdentifier $table = null
Inherited

Parameters

$table

nullstringarray\Zend\Db\Sql\TableIdentifier

Variable overloading

__get(string $name) : mixed
Inherited

Parameters

$name

string

Exceptions

\Zend\Db\Sql\Exception\InvalidArgumentException

Returns

mixed

Specify columns from which to select

columns(array $columns, boolean $prefixColumnsWithTable = true) : \Zend\Db\Sql\Select
Inherited

Possible valid states:

array(*)

array(value, ...) value can be strings or Expression objects

array(string => value, ...) key string will be use as alias, value can be string or Expression objects

Parameters

$columns

array

$prefixColumnsWithTable

boolean

Returns

\Zend\Db\Sql\Select

combine()

combine(\Zend\Db\Sql\Select $select, string $type = self::COMBINE_UNION, string $modifier = '') : \Zend\Db\Sql\Select
Inherited

Parameters

$select

\Zend\Db\Sql\Select

$type

string

$modifier

string

Exceptions

\Zend\Db\Sql\Exception\InvalidArgumentException

Returns

\Zend\Db\Sql\Select

Create from clause

from(string|array|\Zend\Db\Sql\TableIdentifier $table) : \Zend\Db\Sql\Select
Inherited

Parameters

$table

stringarray\Zend\Db\Sql\TableIdentifier

Exceptions

\Zend\Db\Sql\Exception\InvalidArgumentException

Returns

\Zend\Db\Sql\Select

getIsSelectContainDistinct()

getIsSelectContainDistinct() : boolean

Returns

boolean

getRawState()

getRawState($key = null
Inherited

Parameters

$key

Get SQL string for statement

getSqlString(\Zend\Db\Adapter\Platform\PlatformInterface $adapterPlatform = null
Inherited
inherited_from \Zend\Db\Sql\SqlInterface::getSqlString()

Parameters

$adapterPlatform

group()

group($group) 
Inherited

Parameters

$group

Create where clause

having(\Zend\Db\Sql\Where|\Closure|string|array $predicate, string $combination = \Zend\Db\Sql\Predicate\PredicateSet::OP_AND) : \Zend\Db\Sql\Select
Inherited

Parameters

$predicate

\Zend\Db\Sql\Where\Closurestringarray

$combination

string

One of the OP_* constants from Predicate\PredicateSet

Returns

\Zend\Db\Sql\Select

Returns whether the table is read only or not.

isTableReadOnly() : boolean
Inherited

Returns

boolean

Create join clause

join(string|array $name, string $on, string|array $columns = self::SQL_STAR, string $type = self::JOIN_INNER) : \Zend\Db\Sql\Select
Inherited

Parameters

$name

stringarray

$on

string

$columns

stringarray

$type

string

one of the JOIN_* constants

Exceptions

\Zend\Db\Sql\Exception\InvalidArgumentException

Returns

\Zend\Db\Sql\Select

limit()

limit(integer $limit) : \Zend\Db\Sql\Select
Inherited

Parameters

$limit

integer

Returns

\Zend\Db\Sql\Select

offset()

offset(integer $offset) : \Zend\Db\Sql\Select
Inherited

Parameters

$offset

integer

Returns

\Zend\Db\Sql\Select

order()

order(string|array $order) : \Zend\Db\Sql\Select
Inherited

Parameters

$order

stringarray

Returns

\Zend\Db\Sql\Select

prepareStatement()

prepareStatement(\Zend\Db\Adapter\AdapterInterface $adapter, \Zend\Db\Adapter\StatementContainerInterface $statementContainer) : \Zend\Db\Adapter\StatementContainerInterface
Inherited
inherited_from \Zend\Db\Sql\PreparableSqlInterface::prepareStatement()

Parameters

$adapter

$statementContainer

Returns

\Zend\Db\Adapter\StatementContainerInterface

quantifier()

quantifier(string|\Zend\Db\Sql\Expression $quantifier) : \Zend\Db\Sql\Select
Inherited

Parameters

$quantifier

string\Zend\Db\Sql\Expression

DISTINCT|ALL

Returns

\Zend\Db\Sql\Select

reset()

reset(string $part) : \Zend\Db\Sql\Select
Inherited

Parameters

$part

string

Exceptions

\Zend\Db\Sql\Exception\InvalidArgumentException

Returns

\Zend\Db\Sql\Select

setIsSelectContainDistinct()

setIsSelectContainDistinct(boolean $isSelectContainDistinct) 

Parameters

$isSelectContainDistinct

boolean

setSpecification()

setSpecification($index, $specification) 
Inherited

Parameters

$index

$specification

setSubject()

setSubject(\Zend\Db\Sql\Select $select) 
inherited_from \Zend\Db\Sql\Platform\PlatformDecoratorInterface::setSubject()

Parameters

$select

\Zend\Db\Sql\Select

Create where clause

where(\Zend\Db\Sql\Where|\Closure|string|array|\Zend\Db\Sql\Predicate\PredicateInterface $predicate, string $combination = \Zend\Db\Sql\Predicate\PredicateSet::OP_AND) : \Zend\Db\Sql\Select
Inherited

Parameters

$predicate

\Zend\Db\Sql\Where\Closurestringarray\Zend\Db\Sql\Predicate\PredicateInterface

$combination

string

One of the OP_* constants from Predicate\PredicateSet

Exceptions

\Zend\Db\Sql\Exception\InvalidArgumentException

Returns

\Zend\Db\Sql\Select

buildSqlString()

buildSqlString(\Zend\Db\Adapter\Platform\PlatformInterface $platform, null|\Zend\Db\Adapter\Driver\DriverInterface $driver = null, null|\Zend\Db\Adapter\ParameterContainer $parameterContainer = null) : string
Inherited

Parameters

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

null\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

null\Zend\Db\Adapter\ParameterContainer

Returns

string

createSqlFromSpecificationAndParameters()

createSqlFromSpecificationAndParameters(string|array $specifications, string|array $parameters) : string
Inherited

Parameters

$specifications

stringarray

$parameters

stringarray

Exceptions

\Zend\Db\Sql\Exception\RuntimeException

Returns

string

localizeVariables()

localizeVariables() 

Copy variables from the subject into the local properties

localizeVariables() 
Inherited

processCombine()

processCombine(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processExpression()

processExpression(\Zend\Db\Sql\ExpressionInterface $expression, \Zend\Db\Adapter\Platform\PlatformInterface $platform, null|\Zend\Db\Adapter\Driver\DriverInterface $driver = null, null|\Zend\Db\Adapter\ParameterContainer $parameterContainer = null, null|string $namedParameterPrefix = null) : string
Inherited
staticvar int $runtimeExpressionPrefix

Parameters

$expression

\Zend\Db\Sql\ExpressionInterface

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

null\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

null\Zend\Db\Adapter\ParameterContainer

$namedParameterPrefix

nullstring

Exceptions

\Zend\Db\Sql\Exception\RuntimeException

Returns

string

processGroup()

processGroup(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processHaving()

processHaving(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processJoins()

processJoins(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processLimit()

processLimit(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processLimitOffset()

processLimitOffset(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null, array $sqls, array $parameters) 

Parameters

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

\Zend\Db\Adapter\ParameterContainer

$sqls

array

$parameters

array

processOffset()

processOffset(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processOrder()

processOrder(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

Process the select part

processSelect(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null) : null | array
Inherited

Parameters

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

\Zend\Db\Adapter\ParameterContainer

Returns

nullarray

processStatementEnd()

processStatementEnd(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processStatementStart()

processStatementStart(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

processSubSelect()

processSubSelect(\Zend\Db\Sql\Select $subselect, \Zend\Db\Adapter\Platform\PlatformInterface $platform, null|\Zend\Db\Adapter\Driver\DriverInterface $driver = null, null|\Zend\Db\Adapter\ParameterContainer $parameterContainer = null) : string
Inherited

Parameters

$subselect

\Zend\Db\Sql\Select

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

null\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

null\Zend\Db\Adapter\ParameterContainer

Returns

string

processWhere()

processWhere(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
Inherited

Parameters

$platform

$driver

$parameterContainer

Render table with alias in from/join parts

renderTable(string $table, string $alias = null
see
inherited_from \Zend\Db\Sql\Select::renderTable()

Parameters

$table

$alias

Render table with alias in from/join parts

renderTable(string $table, string $alias = null) : string
Inherited
todo move TableIdentifier concatination here

Parameters

$table

string

$alias

string

Returns

string

resolveColumnValue()

resolveColumnValue(null|array|\Zend\Db\Sql\ExpressionInterface|\Zend\Db\Sql\Select $column, \Zend\Db\Adapter\Platform\PlatformInterface $platform, null|\Zend\Db\Adapter\Driver\DriverInterface $driver = null, null|\Zend\Db\Adapter\ParameterContainer $parameterContainer = null, null|string $namedParameterPrefix = null) : string
Inherited

Parameters

$column

nullarray\Zend\Db\Sql\ExpressionInterface\Zend\Db\Sql\Select

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

null\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

null\Zend\Db\Adapter\ParameterContainer

$namedParameterPrefix

nullstring

Returns

string

resolveTable()

resolveTable(string|\Zend\Db\Sql\TableIdentifier|\Zend\Db\Sql\Select $table, \Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null) : string
Inherited

Parameters

$table

string\Zend\Db\Sql\TableIdentifier\Zend\Db\Sql\Select

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

\Zend\Db\Adapter\ParameterContainer

Returns

string

 Properties

 

$columns

$columns : array

Default

array(self::SQL_STAR)
 

$combine

$combine : array

Default

array()
 

$group

$group : null | array

Default

null
 

$having

$having : null | string | array

Default

null
 

$instanceParameterIndex

$instanceParameterIndex : array

Default

array()
 

$isSelectContainDistinct

$isSelectContainDistinct : boolean

Default

false
 

$joins

$joins : array

Default

array()
 

$limit

$limit : integer | null

Default

null
 

$offset

$offset : integer | null

Default

null
 

$order

$order : array

Default

array()
 

$prefixColumnsWithTable

$prefixColumnsWithTable : boolean

Default

true
 

$processInfo

$processInfo : string

Default

array('paramPrefix' => '', 'subselectCount' => 0)
 

$quantifier

$quantifier : null | string | \Zend\Db\Sql\Expression

Default

null
 

Specifications for Sql String generation

$specifications : array<mixed,string> | array<mixed,array>

Default

array()
 

$subject

$subject : \Zend\Db\Sql\Select

Default

null
 

$table

$table : string | array | \Zend\Db\Sql\TableIdentifier

Default

null
 

$tableReadOnly

$tableReadOnly : boolean

Default

false
 

$where

$where : \Zend\Db\Sql\Where

Default

null

 Constants

 

COLUMNS

COLUMNS = 'columns' 
 

COMBINE

COMBINE = 'combine' 
 

COMBINE_EXCEPT

COMBINE_EXCEPT = 'except' 
 

COMBINE_INTERSECT

COMBINE_INTERSECT = 'intersect' 
 

COMBINE_UNION

COMBINE_UNION = 'union' 
 

GROUP

GROUP = 'group' 
 

HAVING

HAVING = 'having' 
 

JOINS

JOINS = 'joins' 
 

JOIN_INNER

JOIN_INNER = 'inner' 
 

JOIN_LEFT

JOIN_LEFT = 'left' 
 

JOIN_OUTER

JOIN_OUTER = 'outer' 
 

JOIN_OUTER_LEFT

JOIN_OUTER_LEFT = 'outer left' 
 

JOIN_OUTER_RIGHT

JOIN_OUTER_RIGHT = 'outer right' 
 

JOIN_RIGHT

JOIN_RIGHT = 'right' 
 

LIMIT

LIMIT = 'limit' 
 

OFFSET

OFFSET = 'offset' 
 

ORDER

ORDER = 'order' 
 

ORDER_ASCENDING

ORDER_ASCENDING = 'ASC' 
 

ORDER_DESCENDING

ORDER_DESCENDING = 'DESC' 
 

QUANTIFIER

QUANTIFIER = 'quantifier' 
 

QUANTIFIER_ALL

QUANTIFIER_ALL = 'ALL' 
 

QUANTIFIER_DISTINCT

QUANTIFIER_DISTINCT = 'DISTINCT' 
 

SELECT

SELECT = 'select' 
 

SQL_STAR

SQL_STAR = '*' 
 

TABLE

TABLE = 'table' 
 

WHERE

WHERE = 'where'