Combine SQL statement - allows combining multiple select statements into one

package Default
inherited_from \Zend\Db\Sql\AbstractPreparableSql

 Methods

__construct()

__construct(\Zend\Db\Sql\Select|array|null $select = null, string $type = self::COMBINE_UNION, string $modifier = ''

Parameters

$select

\Zend\Db\Sql\Selectarraynull

$type

string

$modifier

string

alignColumns()

alignColumns() : \Zend\Db\Sql\Combine
fluent This method is part of a fluent interface and will return the same instance

Returns

\Zend\Db\Sql\Combine

Create combine clause

combine(\Zend\Db\Sql\Select|array $select, string $type = self::COMBINE_UNION, string $modifier = '') : \Zend\Db\Sql\Combine
fluent This method is part of a fluent interface and will return the same instance

Parameters

$select

\Zend\Db\Sql\Selectarray

$type

string

$modifier

string

Returns

\Zend\Db\Sql\Combine

Create except clause

except(\Zend\Db\Sql\Select|array $select, string $modifier = '') : \Zend\Db\Sql\Combine
fluent This method is part of a fluent interface and will return the same instance

Parameters

$select

\Zend\Db\Sql\Selectarray

$modifier

string

Returns

\Zend\Db\Sql\Combine

Get raw state

getRawState(string $key = null) : array

Parameters

$key

string

Returns

array

Get SQL string for statement

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

Parameters

$adapterPlatform

Create intersect clause

intersect(\Zend\Db\Sql\Select|array $select, string $modifier = '') : \Zend\Db\Sql\Combine
fluent This method is part of a fluent interface and will return the same instance

Parameters

$select

\Zend\Db\Sql\Selectarray

$modifier

string

Returns

\Zend\Db\Sql\Combine

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

Create union clause

union(\Zend\Db\Sql\Select|array $select, string $modifier = '') : \Zend\Db\Sql\Combine
fluent This method is part of a fluent interface and will return the same instance

Parameters

$select

\Zend\Db\Sql\Selectarray

$modifier

string

Returns

\Zend\Db\Sql\Combine

Build sql string

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

Parameters

$platform

\Zend\Db\Adapter\Platform\PlatformInterface

$driver

\Zend\Db\Adapter\Driver\DriverInterface

$parameterContainer

\Zend\Db\Adapter\ParameterContainer

Returns

string

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

Copy variables from the subject into the local properties

localizeVariables() 
Inherited

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

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

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

 

$instanceParameterIndex

$instanceParameterIndex : array

Default

array()
 

$processInfo

$processInfo : string

Default

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

$specifications

$specifications : array<mixed,string>

Default

array(self::COMBINE => '%1$s (%2$s) ')
 

Specifications for Sql String generation

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

Default

array()
 

$combine

$combine : array<mixed,\Zend\Db\Sql\Select[]>

Default

array()

 Constants

 

COLUMNS

COLUMNS = 'columns' 
 

COMBINE

COMBINE = 'combine' 
 

COMBINE_EXCEPT

COMBINE_EXCEPT = 'except' 
 

COMBINE_INTERSECT

COMBINE_INTERSECT = 'intersect' 
 

COMBINE_UNION

COMBINE_UNION = 'union'