Inheritances
Files
Overview
FRAMES
NO FRAMES

Abstract class Doctrine_Query_Abstract

Doctrine
|-Doctrine_Query
|-abstract class Doctrine_Query_Abstract
Doctrine_Query_Abstract
PackageDoctrine
SubpackageQuery
Licensehttp://www.opensource.org/licenses/lgpl-license.php LGPL
Linkwww.phpdoctrine.org
Since1.0
Version$Revision: 1393 $
AuthorKonsta Vesterinen
TodoSee {@link Doctrine_Query}

Overview

Instance methods__construct() _addDqlQueryPart() _constructQueryFromCache() _execute() _getDqlCallback() _getDqlCallbackComponents() _getParser() _hasDqlQueryPart() _preQuery() _processDqlQueryPart() _processWhereIn() addFrom() addGroupBy() addHaving() addOrderBy() addQueryPart() addSelect() addSqlQueryPart() addSqlTableAlias() addTableAlias() addWhere() andWhere() andWhereIn() andWhereNotIn() calculateQueryCacheHash() calculateResultCacheHash() clear() copySubqueryInfo() delete() distinct() execute() expireCache() expireQueryCache() expireResultCache() forUpdate() from() generateNewSqlTableAlias() generateNewTableAlias() generateSqlTableAlias() generateTableAlias() getAliasDeclaration() getAliasMap() getCacheDriver() getCachedForm() getComponentAlias() getConnection() getDql() getInheritanceCondition() getParams() getParts() getQuery() getQueryCacheDriver() getQueryCacheLifeSpan() getQueryComponent() getQueryComponents() getQueryPart() getRawParams() getResultCacheDriver() getResultCacheLifeSpan() getRoot() getRootAlias() getRootDeclaration() getSql() getSqlParts() getSqlQuery() getSqlQueryPart() getSqlTableAlias() getSqlTableAliasSeed() getTableAlias() getTableAliasMap() getTableAliasSeed() getTableAliases() getType() getView() groupBy() hasAliasDeclaration() hasSqlTableAlias() hasTableAlias() having() innerJoin() isLimitSubqueryUsed() leftJoin() limit() offset() orWhere() orWhereIn() orWhereNotIn() orderBy() parseDqlQuery() parseQuery() preQuery() removeDqlQueryPart() removeQueryPart() removeSqlQueryPart() select() set() setCacheLifeSpan() setHydrationMode() setOption() setParams() setQueryCacheLifeSpan() setQueryPart() setResultCacheLifeSpan() setSqlQueryPart() setView() update() useCache() useQueryCache() useResultCache() where() whereIn() whereNotIn()

Summary

Class constants
SELECT constant for SELECT queries
DELETE constant for DELETE queries
UPDATE constant for UPDATE queries
INSERT constant for INSERT queries
CREATE constant for CREATE queries
STATE_CLEAN A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts
STATE_DIRTY A query object is in state DIRTY when it has DQL parts that have not yet been
STATE_DIRECT A query is in DIRECT state when .
STATE_LOCKED A query object is on LOCKED state when .
Instance fields
# $_components
# $_conn
# $_dqlParts
# $_expireQueryCache
# $_expireResultCache
# $_hydrator
# $_isLimitSubqueryUsed
# $_options
# $_params
# $_parser
# $_preQueried
# $_queryCache
# $_queryCacheTTL
# $_queryComponents
# $_resultCache
# $_resultCacheTTL
# $_rootAlias Stores the root DQL alias
# $_sqlParts
# $_state
# $_tableAliasMap
# $_tableAliasSeeds
# $_tokenizer
# $_type
# $_view
Instance methods
+ __construct() Constructor
# _addDqlQueryPart() Adds a DQL part to the internal parts collection
# _constructQueryFromCache() Constructs the query from the cached form
# _execute() _execute
# _getDqlCallback() Get the dql call back for this query
# _getDqlCallbackComponents() Returns an array of components to execute the query callbacks for
# _getParser() _getParser
# _hasDqlQueryPart() Checks if there's at least one DQL part defined to the internal parts collection
# _preQuery() Pre query method which invokes the pre*Query() methods on the model instance or any attached
# _processDqlQueryPart() _processDqlQueryPart
# _processWhereIn()
+ addFrom() addFrom
+ addGroupBy() addGroupBy
+ addHaving() addHaving
+ addOrderBy() addOrderBy
+ addQueryPart() addQueryPart
+ addSelect() addSelect
+ addSqlQueryPart() addSqlQueryPart
+ addSqlTableAlias() addSqlTableAlias
+ addTableAlias() addTableAlias
+ addWhere() addWhere
+ andWhere() Adds conditions to the WHERE part of the query
+ andWhereIn() Adds IN condition to the query WHERE part
+ andWhereNotIn() Adds NOT IN condition to the query WHERE part
+ calculateQueryCacheHash() calculateQueryCacheHash
+ calculateResultCacheHash() calculateResultCacheHash
# clear() clear
+ copySubqueryInfo() copyAliases
+ delete() delete
+ distinct() distinct
+ execute() execute
+ expireCache() expireCache
+ expireQueryCache() expireQueryCache
+ expireResultCache() expireCache
+ forUpdate() forUpdate
+ from() from
+ generateNewSqlTableAlias() generateNewSqlTableAlias
+ generateNewTableAlias() generateNewTableAlias
+ generateSqlTableAlias() generateSqlTableAlias
+ generateTableAlias() generateTableAlias
+ getAliasDeclaration() getAliasDeclaration
+ getAliasMap()
+ getCacheDriver() getCacheDriver
+ getCachedForm() getCachedForm
+ getComponentAlias() getComponentAlias
+ getConnection() getConnection
+ getDql() getDql
+ getInheritanceCondition() Returns the inheritance condition for the passed componentAlias
+ getParams() getParams
+ getParts() Return the SQL parts
+ getQuery()
+ getQueryCacheDriver() getQueryCacheDriver
+ getQueryCacheLifeSpan() Gets the life span of the query cache the Query object is using
+ getQueryComponent() getQueryComponent
+ getQueryComponents() Gets the components of this query
+ getQueryPart() getQueryPart
+ getRawParams() Get the raw array of parameters
+ getResultCacheDriver() getResultCacheDriver
+ getResultCacheLifeSpan() Gets the life span of the result cache in seconds
+ getRoot() getRoot
+ getRootAlias() getRootAlias
+ getRootDeclaration() getRootDeclaration
+ getSql() getSql
+ getSqlParts() Return the SQL parts
+ getSqlQuery() Gets the SQL query that corresponds to this query object.
+ getSqlQueryPart() getSqlQueryPart
+ getSqlTableAlias() getSqlTableAlias
+ getSqlTableAliasSeed() getSqlTableAliasSeed
+ getTableAlias() getTableAlias
+ getTableAliasMap() getTableAliasMap
+ getTableAliasSeed() getTableAliasSeed
+ getTableAliases() getTableAliases
+ getType() getType
+ getView() getView
+ groupBy() groupBy
+ hasAliasDeclaration() hasAliasDeclaration
+ hasSqlTableAlias() hasSqlTableAlias
+ hasTableAlias() hasTableAlias
+ having() having
+ innerJoin() innerJoin
+ isLimitSubqueryUsed() limitSubqueryUsed
+ leftJoin() leftJoin
+ limit() limit
+ offset() offset
+ orWhere() Adds conditions to the WHERE part of the query
+ orWhereIn() Adds IN condition to the query WHERE part
+ orWhereNotIn() Adds NOT IN condition to the query WHERE part
+ orderBy() orderBy
+ parseDqlQuery() parseDqlQuery
+ parseQuery()
+ preQuery() Blank hook methods which can be implemented in Doctrine_Query child classes
+ removeDqlQueryPart() removeDqlQueryPart
+ removeQueryPart() removeQueryPart
+ removeSqlQueryPart() removeSqlQueryPart
+ select() select
+ set() set
+ setCacheLifeSpan() setCacheLifeSpan
+ setHydrationMode()
+ setOption() setOption
+ setParams() setParams
+ setQueryCacheLifeSpan() setQueryCacheLifeSpan
+ setQueryPart() setQueryPart
+ setResultCacheLifeSpan() setResultCacheLifeSpan
+ setSqlQueryPart() setSqlQueryPart
+ setView() setView
+ update() update
+ useCache() useCache
+ useQueryCache() useQueryCache
+ useResultCache() useResultCache
+ where() where
+ whereIn() whereIn
+ whereNotIn() whereNotIn

Details

Class constants

SELECT
const SELECT = 0
constant for SELECT queries
DELETE
const DELETE = 1
constant for DELETE queries
UPDATE
const UPDATE = 2
constant for UPDATE queries
INSERT
const INSERT = 3
constant for INSERT queries
CREATE
const CREATE = 4
constant for CREATE queries
STATE_CLEAN
const STATE_CLEAN = 1
A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.
STATE_DIRTY
const STATE_DIRTY = 2
A query object is in state DIRTY when it has DQL parts that have not yet been
parsed/processed.
STATE_DIRECT
const STATE_DIRECT = 3
A query is in DIRECT state when ... ?
STATE_LOCKED
const STATE_LOCKED = 4
A query object is on LOCKED state when ... ?

Instance fields

$_components
protected $_components
Var array components used in the DQL statement
$_conn
protected $_conn
Var Doctrine_Connection The connection used by this query object.
$_dqlParts
protected $_dqlParts = array( 'from' => array(), 'select' => array(), 'forUpdate' => false, 'set' => array(), 'join' => array(), 'where' => array(), 'groupby' => array(), 'having' => array(), 'orderby' => array(), 'limit' => array(), 'offset' => array(), )
Var array $_dqlParts an array containing all DQL query parts
$_expireResultCache
protected $_expireResultCache = false
Var boolean $_expireResultCache A boolean value that indicates whether or not
expire the result cache.
$_hydrator
protected $_hydrator
Var Doctrine_Hydrator The hydrator object used to hydrate query results.
$_options
protected $_options = array( 'hydrationMode' => Doctrine::HYDRATE_RECORD )
Var array $_options an array of options
$_params
protected $_params = array('join' => array(), 'where' => array(), 'set' => array(), 'having' => array())
Var array $params The parameters of this query.
$_parser
protected $_parser
Var Doctrine_Query_Parser The parser that is used for query parsing.
$_preQueried
protected $_preQueried = false
Var bool Boolean variable for whether or not the preQuery process has been executed
$_queryCache
protected $_queryCache
Var Doctrine_Cache_Interface The cache driver used for caching queries.
$_queryComponents
protected $_queryComponents = array()
Var array $_queryComponents Two dimensional array containing the components of this query,
informations about their relations and other related information.
The components are constructed during query parsing.

Keys are component aliases and values the following:

table table object associated with given alias

relation the relation object owned by the parent

parent the alias of the parent

agg the aggregates of this component

map the name of the column / aggregate value this
component is mapped to a collection
$_resultCache
protected $_resultCache
Var Doctrine_Cache_Interface The cache driver used for caching result sets.
$_rootAlias
protected $_rootAlias = ''
Stores the root DQL alias
Var string
$_sqlParts
protected $_sqlParts = array( 'select' => array(), 'distinct' => false, 'forUpdate' => false, 'from' => array(), 'set' => array(), 'join' => array(), 'where' => array(), 'groupby' => array(), 'having' => array(), 'orderby' => array(), 'limit' => false, 'offset' => false, )
Var array $_sqlParts The SQL query string parts. Filled during the DQL parsing process.
$_state
protected $_state = Doctrine_Query::STATE_CLEAN
Var integer $_state The current state of this query.
$_tableAliasMap
protected $_tableAliasMap = array()
Var array Table alias map. Keys are SQL aliases and values DQL aliases.
$_tableAliasSeeds
protected $_tableAliasSeeds = array()
Var array $_tableAliasSeeds A simple array keys representing table aliases and values
table alias seeds. The seeds are used for generating short table
aliases.
$_tokenizer
protected $_tokenizer
Var Doctrine_Query_Tokenizer The tokenizer that is used during the query parsing process.
$_type
protected $_type = self::SELECT
See also Doctrine_Query::* constants
Var integer $type the query type
$_view
protected $_view
Var Doctrine_View The view object used by this query, if any.

Instance methods

__construct()
public function __construct( Doctrine_Connection $connection = null
Doctrine_Hydrator_Abstract $hydrator = null
)
Constructor.
Parameters
Doctrine_Connection $connection
Doctrine_Hydrator_Abstract $hydrator
Overriden by __construct() in class : Doctrine_RawSql
_addDqlQueryPart()
protected function _addDqlQueryPart( $queryPartName
$queryPart
$append = false
)
Adds a DQL part to the internal parts collection.
Parameters
string $queryPartName The name of the query part.
string $queryPart The actual query part to add.
boolean $append Whether to append $queryPart to already existing
parts under the same $queryPartName. Defaults to FALSE
(previously added parts with the same name get overridden).
Overriden by _addDqlQueryPart() in class : Doctrine_RawSql
_constructQueryFromCache()
protected function _constructQueryFromCache( $cached)
Constructs the query from the cached form.
Parameters
$cached
Returns array The custom component that was cached together with the essential
query data. This can be either a result set (result caching)
or an SQL query string (query caching).
_execute()
protected function _execute( $params)
_execute
Parameters
array $params
Returns PDOStatement The executed PDOStatement.
_getDqlCallback()
protected function _getDqlCallback( )
Get the dql call back for this query
Returns array $callback
_getDqlCallbackComponents()
protected function _getDqlCallbackComponents( $params = array())
Returns an array of components to execute the query callbacks for
Parameters
array $params
Returns array $components
_getParser()
protected function _getParser( $name)
_getParser
parser lazy-loader
Parameters
$name
Throws Doctrine_Query_Exception if unknown parser name given
To do Doc/Description: What is the parameter for? Which parsers are available?
_hasDqlQueryPart()
protected function _hasDqlQueryPart( $queryPartName)
Checks if there's at least one DQL part defined to the internal parts collection.
Parameters
string $queryPartName The name of the query part.
Returns boolean
_preQuery()
protected function _preQuery( $params = array())
Pre query method which invokes the pre*Query() methods on the model instance or any attached
record listeners
Parameters
$params
Returns void
_processDqlQueryPart()
protected function _processDqlQueryPart( $queryPartName
$queryParts
)
_processDqlQueryPart
parses given query part
Parameters
string $queryPartName the name of the query part
array $queryParts an array containing the query part data
Returns Doctrine_Query this object
To do Better description. "parses given query part" ??? Then wheres the difference
between process/parseQueryPart? I suppose this does something different.
_processWhereIn()
protected function _processWhereIn( $expr
$params = array()
$not = false
)
public function addFrom( $from)
addFrom
adds fields to the FROM part of the query
Parameters
string $from Query FROM part
public function addGroupBy( $groupby)
addGroupBy
adds fields to the GROUP BY part of the query
Parameters
string $groupby Query GROUP BY part
public function addHaving( $having
$params = array()
)
addHaving
adds conditions to the HAVING part of the query
Parameters
string $having Query HAVING part
mixed $params an array of parameters or a simple scalar
public function addOrderBy( $orderby)
addOrderBy
adds fields to the ORDER BY part of the query
Parameters
string $orderby Query ORDER BY part
addQueryPart() Deprecated
public function addQueryPart( $name
$part
)
addQueryPart
adds a query part in the query part array
Parameters
string $name the name of the query part to be added
string $part query part string
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to add unknown query part
public function addSelect( $select)
addSelect
adds fields to the SELECT part of the query
Parameters
string $select Query SELECT part
public function addSqlQueryPart( $name
$part
)
addSqlQueryPart
adds an SQL query part to the SQL query part array
Parameters
string $name the name of the query part to be added
string $part query part string
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to add unknown query part
public function addSqlTableAlias( $sqlTableAlias
$componentAlias
)
addSqlTableAlias
adds an SQL table alias and associates it a component alias
Parameters
$sqlTableAlias
string $componentAlias the alias for the query component associated with given tableAlias
addTableAlias() Deprecated
public function addTableAlias( $tableAlias
$componentAlias
)
addTableAlias
adds an alias for table and associates it with given component alias
Parameters
string $tableAlias the table alias to be added
string $componentAlias the alias for the query component associated with given tableAlias
Returns Doctrine_Hydrate
public function addWhere( $where
$params = array()
)
addWhere
adds conditions to the WHERE part of the query
Parameters
string $where Query WHERE part
mixed $params an array of parameters or a simple scalar
public function andWhere( $where
$params = array()
)
Adds conditions to the WHERE part of the query
Parameters
string $where Query WHERE part
mixed $params An array of parameters or a simple scalar
public function andWhereIn( $expr
$params = array()
$not = false
)
Adds IN condition to the query WHERE part
Parameters
string $expr The operand of the IN
mixed $params An array of parameters or a simple scalar
boolean $not Whether or not to use NOT in front of IN
public function andWhereNotIn( $expr
$params = array()
)
Adds NOT IN condition to the query WHERE part
Parameters
string $expr The operand of the NOT IN
mixed $params An array of parameters or a simple scalar
public function calculateQueryCacheHash( )
calculateQueryCacheHash
calculate hash key for query cache
Returns string the hash
public function calculateResultCacheHash( $params = array())
calculateResultCacheHash
calculate hash key for result cache
Parameters
array $params
Returns string the hash
Overriden by calculateResultCacheHash() in class : Doctrine_RawSql
protected function clear( )
clear
resets all the variables
Returns void
public function copySubqueryInfo( Doctrine_Query_Abstract $query)
copyAliases
copy aliases from another Hydrate object

this method is needed by DQL subqueries which need the aliases
of the parent query
Parameters
Doctrine_Query_Abstract $query
Returns Doctrine_Hydrate this object
public function delete( $from = null)
delete
sets the query type to DELETE
Parameters
$from
public function distinct( $flag = true)
distinct
Makes the query SELECT DISTINCT.
Parameters
bool $flag Whether or not the SELECT is DISTINCT (default true).
public function execute( $params = array()
$hydrationMode = null
)
execute
executes the query and populates the data set
Parameters
array $params
$hydrationMode
Returns Doctrine_Collection the root collection
expireCache() Deprecated
public function expireCache( $expire = true)
expireCache
Parameters
boolean $expire whether or not to force cache expiration
Returns Doctrine_Hydrate this object
public function expireQueryCache( $expire = true)
expireQueryCache
Parameters
boolean $expire whether or not to force cache expiration
Returns Doctrine_Hydrate this object
public function expireResultCache( $expire = true)
expireCache
Parameters
boolean $expire whether or not to force cache expiration
Returns Doctrine_Hydrate this object
public function forUpdate( $flag = true)
forUpdate
Makes the query SELECT FOR UPDATE.
Parameters
bool $flag Whether or not the SELECT is FOR UPDATE (default true).
public function from( $from)
from
sets the FROM part of the query
Parameters
string $from Query FROM part
public function generateNewSqlTableAlias( $oldAlias)
generateNewSqlTableAlias
generates a new alias from given table alias
Parameters
$oldAlias
Returns string the created table alias
public function generateNewTableAlias( $oldAlias)
generateNewTableAlias
generates a new alias from given table alias
Parameters
$oldAlias
Returns string the created table alias
public function generateSqlTableAlias( $componentAlias
$tableName
)
generateSqlTableAlias
generates a table alias from given table name and associates
it with given component alias
Parameters
string $componentAlias the component alias to be associated with generated table alias
string $tableName the table name from which to generate the table alias
Returns string the generated table alias
public function generateTableAlias( $componentAlias
$tableName
)
generateTableAlias
generates a table alias from given table name and associates
it with given component alias
Parameters
string $componentAlias the component alias to be associated with generated table alias
string $tableName the table name from which to generate the table alias
Returns string the generated table alias
public function getAliasDeclaration( $componentAlias)
getAliasDeclaration
get the declaration for given component alias
Parameters
string $componentAlias the component alias the retrieve the declaration from
Returns array the alias declaration
getCacheDriver() Deprecated
public function getCacheDriver( )
getCacheDriver
returns the cache driver associated with this object
Returns Doctrine_Cache_Interface|boolean|null cache driver
public function getCachedForm( $customComponent = null)
getCachedForm
returns the cached form of this query for given resultSet
Parameters
$customComponent
Returns string serialized string representation of this query
public function getComponentAlias( $sqlTableAlias)
getComponentAlias
get component alias associated with given table alias
Parameters
string $sqlTableAlias the SQL table alias that identifies the component alias
Returns string component alias
public function getDql( )
getDql
returns the DQL query that is represented by this query object.

the query is built from $_dqlParts
Returns string the DQL query
public function getInheritanceCondition( $componentAlias)
Returns the inheritance condition for the passed componentAlias
If no component alias is specified it defaults to the root component

This function is used to append a SQL condition to models which have inheritance mapping
The condition is applied to the FROM component in the WHERE, but the condition is applied to
JOINS in the ON condition and not the WHERE
Parameters
$componentAlias
Returns string $str SQL condition string
public function getParams( $params = array())
getParams
Parameters
$params
Returns array
getParts() Deprecated
public function getParts( )
Return the SQL parts.
Returns array The parts
getQuery() Deprecated
public function getQuery( $params = array())
Parameters
$params
public function getQueryCacheDriver( )
getQueryCacheDriver
returns the cache driver used for caching queries
Returns Doctrine_Cache_Interface|boolean|null cache driver
public function getQueryCacheLifeSpan( )
Gets the life span of the query cache the Query object is using.
Returns integer The life span in seconds.
public function getQueryComponent( $componentAlias)
getQueryComponent
get the declaration for given component alias
Parameters
string $componentAlias the component alias the retrieve the declaration from
Returns array the alias declaration
public function getQueryComponents( )
Gets the components of this query.
getQueryPart() Deprecated
public function getQueryPart( $part)
getQueryPart
gets a query part from the query part array
Parameters
string $part query part string
Returns Doctrine_Query_Abstract this object
Throws Doctrine_Query_Exception if trying to set unknown query part
public function getRawParams( )
Get the raw array of parameters
Returns array
public function getResultCacheDriver( )
getResultCacheDriver
returns the cache driver used for caching result sets
Returns Doctrine_Cache_Interface|boolean|null cache driver
public function getResultCacheLifeSpan( )
Gets the life span of the result cache in seconds.
Returns integer
public function getRoot( )
getRoot
returns the root component for this object
Returns Doctrine_Table root components table
public function getRootAlias( )
getRootAlias
returns the alias of the the root component
Returns array
public function getRootDeclaration( )
getRootDeclaration
returns the root declaration
Returns array
public function getSql( $params = array())
getSql
shortcut for getSqlQuery().
Parameters
array $params (optional)
Returns string sql query string
public function getSqlParts( )
Return the SQL parts.
Returns array The parts
abstract public function getSqlQuery( $params = array())
Gets the SQL query that corresponds to this query object.
The returned SQL syntax depends on the connection driver that is used
by this query object at the time of this method call.
Parameters
array $params
Overriden by getSqlQuery() in classes : Doctrine_Query, Doctrine_RawSql
public function getSqlQueryPart( $part)
getSqlQueryPart
gets an SQL query part from the SQL query part array
Parameters
string $part query part string
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to set unknown query part
public function getSqlTableAlias( $componentAlias
$tableName = null
)
getSqlTableAlias
some database such as Oracle need the identifier lengths to be < ~30 chars
hence Doctrine creates as short identifier aliases as possible

this method is used for the creation of short table aliases, its also
smart enough to check if an alias already exists for given component (componentAlias)
Parameters
string $componentAlias the alias for the query component to search table alias for
string $tableName the table name from which the table alias is being created
Returns string the generated / fetched short alias
public function getSqlTableAliasSeed( $sqlTableAlias)
getSqlTableAliasSeed
returns the alias seed for given table alias
Parameters
$sqlTableAlias
Returns integer table alias seed
getTableAlias() Deprecated
public function getTableAlias( $componentAlias
$tableName = null
)
getTableAlias
some database such as Oracle need the identifier lengths to be < ~30 chars
hence Doctrine creates as short identifier aliases as possible

this method is used for the creation of short table aliases, its also
smart enough to check if an alias already exists for given component (componentAlias)
Parameters
string $componentAlias the alias for the query component to search table alias for
string $tableName the table name from which the table alias is being created
Returns string the generated / fetched short alias
public function getTableAliasMap( )
getTableAliasMap
returns all table aliases
Returns array table aliases as an array
public function getTableAliasSeed( $sqlTableAlias)
getTableAliasSeed
returns the alias seed for given table alias
Parameters
$sqlTableAlias
Returns integer table alias seed
getTableAliases() Deprecated
public function getTableAliases( )
getTableAliases
returns all table aliases
Returns array table aliases as an array
public function getType( )
getType

returns the type of this query object
by default the type is Doctrine_Query_Abstract::SELECT but if update() or delete()
are being called the type is Doctrine_Query_Abstract::UPDATE and Doctrine_Query_Abstract::DELETE,
respectively
Returns integer return the query type
See also Doctrine_Query_Abstract::SELECT
See also Doctrine_Query_Abstract::UPDATE
See also Doctrine_Query_Abstract::DELETE
public function getView( )
getView
returns the view associated with this query object (if any)
Returns Doctrine_View the view associated with this query object
public function groupBy( $groupby)
groupBy
sets the GROUP BY part of the query
Parameters
string $groupby Query GROUP BY part
public function hasAliasDeclaration( $componentAlias)
hasAliasDeclaration
whether or not this object has a declaration for given component alias
Parameters
string $componentAlias the component alias the retrieve the declaration from
Returns boolean
public function hasSqlTableAlias( $sqlTableAlias)
hasSqlTableAlias
whether or not this object has given tableAlias
Parameters
$sqlTableAlias
Returns boolean true if this object has given alias, otherwise false
hasTableAlias() Deprecated
public function hasTableAlias( $sqlTableAlias)
hasTableAlias
whether or not this object has given tableAlias
Parameters
$sqlTableAlias
Returns boolean true if this object has given alias, otherwise false
public function having( $having
$params = array()
)
having
sets the HAVING part of the query
Parameters
string $having Query HAVING part
mixed $params an array of parameters or a simple scalar
public function innerJoin( $join
$params = array()
)
innerJoin
appends an INNER JOIN to the FROM part of the query
Parameters
string $join Query INNER JOIN
$params
public function isLimitSubqueryUsed( )
limitSubqueryUsed
Returns boolean
public function leftJoin( $join
$params = array()
)
leftJoin
appends a LEFT JOIN to the FROM part of the query
Parameters
string $join Query LEFT JOIN
$params
public function limit( $limit)
limit
sets the Query query limit
Parameters
integer $limit limit to be used for limiting the query results
public function offset( $offset)
offset
sets the Query query offset
Parameters
integer $offset offset to be used for paginating the query
public function orWhere( $where
$params = array()
)
Adds conditions to the WHERE part of the query
Parameters
string $where Query WHERE part
mixed $params An array of parameters or a simple scalar
public function orWhereIn( $expr
$params = array()
$not = false
)
Adds IN condition to the query WHERE part
Parameters
string $expr The operand of the IN
mixed $params An array of parameters or a simple scalar
boolean $not Whether or not to use NOT in front of IN
public function orWhereNotIn( $expr
$params = array()
)
Adds NOT IN condition to the query WHERE part
Parameters
string $expr The operand of the NOT IN
mixed $params An array of parameters or a simple scalar
public function orderBy( $orderby)
orderBy
sets the ORDER BY part of the query
Parameters
string $orderby Query ORDER BY part
abstract public function parseDqlQuery( $query)
parseDqlQuery
parses a dql query
Parameters
string $query query to be parsed
Returns Doctrine_Query_Abstract this object
Overriden by parseDqlQuery() in classes : Doctrine_Query, Doctrine_RawSql
parseQuery() Deprecated
public function parseQuery( $query)
Parameters
$query
public function preQuery( )
Blank hook methods which can be implemented in Doctrine_Query child classes
Returns void
public function removeDqlQueryPart( $name)
removeDqlQueryPart
removes a dql query part from the dql query part array
Parameters
string $name the name of the query part to be removed
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to remove unknown query part
removeQueryPart() Deprecated
public function removeQueryPart( $name)
removeQueryPart
removes a query part from the query part array
Parameters
string $name the name of the query part to be removed
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to remove unknown query part
public function removeSqlQueryPart( $name)
removeSqlQueryPart
removes a query part from the query part array
Parameters
string $name the name of the query part to be removed
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to remove unknown query part
public function select( $select)
select
sets the SELECT part of the query
Parameters
string $select Query SELECT part
public function set( $key
$value
$params = null
)
set
sets the SET part of the query
Parameters
$key
$value
$params
setCacheLifeSpan() Deprecated
public function setCacheLifeSpan( $timeToLive)
setCacheLifeSpan
Parameters
integer $timeToLive how long the cache entry is valid
Returns Doctrine_Hydrate this object
public function setHydrationMode( $hydrationMode)
Parameters
$hydrationMode
public function setOption( $name
$value
)
setOption
Parameters
string $name option name
string $value option value
Returns Doctrine_Query this object
public function setParams( array $params = array())
setParams
Parameters
array $params
public function setQueryCacheLifeSpan( $timeToLive)
setQueryCacheLifeSpan
Parameters
integer $timeToLive how long the cache entry is valid
Returns Doctrine_Hydrate this object
setQueryPart() Deprecated
public function setQueryPart( $name
$part
)
setQueryPart
sets a query part in the query part array
Parameters
string $name the name of the query part to be set
string $part query part string
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to set unknown query part
public function setResultCacheLifeSpan( $timeToLive)
setResultCacheLifeSpan
Parameters
integer $timeToLive how long the cache entry is valid (in seconds)
Returns Doctrine_Hydrate this object
public function setSqlQueryPart( $name
$part
)
setSqlQueryPart
sets an SQL query part in the SQL query part array
Parameters
string $name the name of the query part to be set
string $part query part string
Returns Doctrine_Hydrate this object
Throws Doctrine_Query_Exception if trying to set unknown query part
public function setView( Doctrine_View $view)
setView
sets a database view this query object uses
this method should only be called internally by doctrine
Parameters
Doctrine_View $view
Returns void
public function update( $from = null)
update
sets the UPDATE part of the query
Parameters
$from
useCache() Deprecated
public function useCache( $driver = true
$timeToLive = null
)
useCache
Parameters
Doctrine_Cache_Interface|bool $driver cache driver
integer $timeToLive how long the cache entry is valid
Returns Doctrine_Hydrate this object
public function useQueryCache( $driver = true
$timeToLive = null
)
useQueryCache
Parameters
Doctrine_Cache_Interface|bool $driver cache driver
integer $timeToLive how long the cache entry is valid
Returns Doctrine_Hydrate this object
public function useResultCache( $driver = true
$timeToLive = null
)
useResultCache
Parameters
Doctrine_Cache_Interface|bool $driver cache driver
integer $timeToLive how long the cache entry is valid
Returns Doctrine_Hydrate this object
public function where( $where
$params = array()
)
where
sets the WHERE part of the query
Parameters
$where
mixed $params an array of parameters or a simple scalar
public function whereIn( $expr
$params = array()
$not = false
)
whereIn
adds IN condition to the query WHERE part
Parameters
string $expr the operand of the IN
mixed $params an array of parameters or a simple scalar
boolean $not whether or not to use NOT in front of IN
public function whereNotIn( $expr
$params = array()
)
whereNotIn
adds NOT IN condition to the query WHERE part
Parameters
string $expr the operand of the NOT IN
mixed $params an array of parameters or a simple scalar