package |
Default |
inherited_from |
\Zend\Db\Sql\AbstractPreparableSql |
Methods
__clone
__clone() : void
Resets the where object each time the Select is cloned.
Constructor
__construct(null|string|array|\Zend\Db\Sql\TableIdentifier $table = null
)
Parameters
$table
null
string
array
\Zend\Db\Sql\TableIdentifier
Variable overloading
__get(string $name) : mixed
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
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
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
Parameters
$table
string
array
\Zend\Db\Sql\TableIdentifier
Exceptions
\Zend\Db\Sql\Exception\InvalidArgumentException |
|
Returns
\Zend\Db\Sql\Select
getRawState()
getRawState($key = null
)
Get SQL string for statement
getSqlString(\Zend\Db\Adapter\Platform\PlatformInterface $adapterPlatform = null
)
Inherited
inherited_from |
\Zend\Db\Sql\SqlInterface::getSqlString() |
Parameters
$adapterPlatform
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
Parameters
$predicate
\Zend\Db\Sql\Where
\Closure
string
array
$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
Create join clause
join(string|array $name, string $on, string|array $columns = self::SQL_STAR
, string $type = self::JOIN_INNER
) : \Zend\Db\Sql\Select
Parameters
$name
string
array
$on
string
$columns
string
array
$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
Parameters
$limit
integer
Returns
\Zend\Db\Sql\Select
offset()
offset(integer $offset) : \Zend\Db\Sql\Select
Parameters
$offset
integer
Returns
\Zend\Db\Sql\Select
order()
order(string|array $order) : \Zend\Db\Sql\Select
Parameters
$order
string
array
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
Parameters
$quantifier
string
\Zend\Db\Sql\Expression
DISTINCT|ALL
Returns
\Zend\Db\Sql\Select
reset()
reset(string $part) : \Zend\Db\Sql\Select
Parameters
$part
string
Exceptions
\Zend\Db\Sql\Exception\InvalidArgumentException |
|
Returns
\Zend\Db\Sql\Select
setSpecification()
setSpecification($index, $specification)
Parameters
$index
$specification
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
Parameters
$predicate
\Zend\Db\Sql\Where
\Closure
string
array
\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
string
array
$parameters
string
array
Exceptions
\Zend\Db\Sql\Exception\RuntimeException |
|
Returns
string
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
)
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
null
string
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
)
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
)
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
)
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
)
Parameters
$platform
$driver
$parameterContainer
processOffset()
processOffset(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null
, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
)
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
)
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
Parameters
$platform
\Zend\Db\Adapter\Platform\PlatformInterface
$driver
\Zend\Db\Adapter\Driver\DriverInterface
$parameterContainer
\Zend\Db\Adapter\ParameterContainer
Returns
null
array
processStatementEnd()
processStatementEnd(\Zend\Db\Adapter\Platform\PlatformInterface $platform, \Zend\Db\Adapter\Driver\DriverInterface $driver = null
, \Zend\Db\Adapter\ParameterContainer $parameterContainer = null
)
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
)
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
)
Parameters
$platform
$driver
$parameterContainer
Render table with alias in from/join parts
renderTable(string $table, string $alias = null
) : string
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
null
array
\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
null
string
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
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
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
$having
$having : \Zend\Db\Sql\Having
$where
$where : \Zend\Db\Sql\Where
$columns
$columns : array
Default
array(self::SQL_STAR)
$combine
$combine : array
$group
$group : null | array
$having
$having : null | string | array
$instanceParameterIndex
$instanceParameterIndex : array
$limit
$limit : integer | null
$offset
$offset : integer | null
$prefixColumnsWithTable
$prefixColumnsWithTable : boolean
$processInfo
$processInfo : string
Default
array('paramPrefix' => '', 'subselectCount' => 0)
$quantifier
$quantifier : null | string | \Zend\Db\Sql\Expression
Specifications
$specifications : array
Default
array('statementStart' => '%1$s', self::SELECT => array('SELECT %1$s FROM %2$s' => array(array(1 => '%1$s', 2 => '%1$s AS %2$s', 'combinedby' => ', '), null), 'SELECT %1$s %2$s FROM %3$s' => array(null, array(1 => '%1$s', 2 => '%1$s AS %2$s', 'combinedby' => ', '), null), 'SELECT %1$s' => array(array(1 => '%1$s', 2 => '%1$s AS %2$s', 'combinedby' => ', '))), self::JOINS => array('%1$s' => array(array(3 => '%1$s JOIN %2$s ON %3$s', 'combinedby' => ' '))), self::WHERE => 'WHERE %1$s', self::GROUP => array('GROUP BY %1$s' => array(array(1 => '%1$s', 'combinedby' => ', '))), self::HAVING => 'HAVING %1$s', self::ORDER => array('ORDER BY %1$s' => array(array(1 => '%1$s', 2 => '%1$s %2$s', 'combinedby' => ', '))), self::LIMIT => 'LIMIT %1$s', self::OFFSET => 'OFFSET %1$s', 'statementEnd' => '%1$s', self::COMBINE => '%1$s ( %2$s )')
Specifications for Sql String generation
$specifications : array<mixed,string> | array<mixed,array>
$table
$table : string | array | \Zend\Db\Sql\TableIdentifier
$tableReadOnly
$tableReadOnly : boolean
$where
$where : \Zend\Db\Sql\Where
Constants
COLUMNS
COLUMNS = 'columns'
COMBINE
COMBINE = 'combine'
COMBINE_EXCEPT
COMBINE_EXCEPT = 'except'
COMBINE_INTERSECT
COMBINE_INTERSECT = 'intersect'
COMBINE_UNION
COMBINE_UNION = 'union'
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'
ORDER_ASCENDING
ORDER_ASCENDING = 'ASC'
ORDER_DESCENDING
ORDER_DESCENDING = 'DESC'
QUANTIFIER
QUANTIFIER = 'quantifier'
QUANTIFIER_ALL
QUANTIFIER_ALL = 'ALL'
QUANTIFIER_DISTINCT
QUANTIFIER_DISTINCT = 'DISTINCT'