| Package | Doctrine |
| Subpackage | Query |
| License | http://www.opensource.org/licenses/lgpl-license.php LGPL |
| Link | www.phpdoctrine.org |
| Since | 1.0 |
| Version | $Revision: 1393 $ |
| Author | Konsta Vesterinen |
| Todo | See {@link Doctrine_Query} |
| Package | Doctrine |
| Subpackage | Query |
| License | http://www.opensource.org/licenses/lgpl-license.php LGPL |
| Link | www.phpdoctrine.org |
| Since | 1.0 |
| Version | $Revision: 1393 $ |
| Author | Konsta Vesterinen |
| Todo | See {@link Doctrine_Query} |
| 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 . |
| # $_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 |
| + __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 |
const STATE_CLEAN = 1A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.const STATE_DIRTY = 2A query object is in state DIRTY when it has DQL parts that have not yet beenconst STATE_LOCKED = 4A query object is on LOCKED state when ... ?protected $_componentsprotected $_connDoctrine_Connection The connection used by this query object.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(),
)protected $_expireQueryCache = falseprotected $_expireResultCache = falseA boolean value that indicates whether or notprotected $_hydratorDoctrine_Hydrator The hydrator object used to hydrate query results.protected $_isLimitSubqueryUsed = falseprotected $_options = array(
'hydrationMode' => Doctrine::HYDRATE_RECORD
)protected $_params = array('join' => array(),
'where' => array(),
'set' => array(),
'having' => array())protected $_parserDoctrine_Query_Parser The parser that is used for query parsing.protected $_preQueried = falseprotected $_queryCacheDoctrine_Cache_Interface The cache driver used for caching queries.protected $_queryCacheTTLprotected $_queryComponents = array()protected $_resultCacheDoctrine_Cache_Interface The cache driver used for caching result sets.protected $_resultCacheTTLprotected $_rootAlias = ''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,
)protected $_state = Doctrine_Query::STATE_CLEANprotected $_tableAliasMap = array()Table alias map. Keys are SQL aliases and values DQL aliases.protected $_tableAliasSeeds = array()A simple array keys representing table aliases and valuesprotected $_tokenizerDoctrine_Query_Tokenizer The tokenizer that is used during the query parsing process.protected $_type = self::SELECTDoctrine_Query::* constantsprotected $_viewDoctrine_View The view object used by this query, if any.
public function __construct( |
)
|
protected function _addDqlQueryPart( |
$queryPartName)
|
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). |
protected function _constructQueryFromCache( |
$cached)
|
$cached |
protected function _execute( |
$params)
|
array $params |
protected function _getDqlCallback( |
)
|
protected function _getDqlCallbackComponents( |
$params = array())
|
array $params |
protected function _getParser( |
$name)
|
$name |
Doctrine_Query_PartDoctrine_Query_Exception if unknown parser name givenDescription: What is the parameter for? Which parsers are available?
protected function _hasDqlQueryPart( |
$queryPartName)
|
string $queryPartName |
The name of the query part. |
protected function _preQuery( |
$params = array())
|
$params |
protected function _processDqlQueryPart( |
$queryPartName)
|
string $queryPartName |
the name of the query part |
array $queryParts |
an array containing the query part data |
Doctrine_Query this object
protected function _processWhereIn( |
$expr)
|
$expr |
|
$params |
|
$not |
public function addFrom( |
$from)
|
string $from |
Query FROM part |
Doctrine_Query
public function addGroupBy( |
$groupby)
|
string $groupby |
Query GROUP BY part |
Doctrine_Query
public function addHaving( |
$having)
|
string $having |
Query HAVING part |
mixed $params |
an array of parameters or a simple scalar |
Doctrine_Query
public function addOrderBy( |
$orderby)
|
string $orderby |
Query ORDER BY part |
Doctrine_Query
public function addQueryPart( |
$name)
|
string $name |
the name of the query part to be added |
string $part |
query part string |
Doctrine_Query_Exception if trying to add unknown query part
public function addSelect( |
$select)
|
string $select |
Query SELECT part |
Doctrine_Query
public function addSqlQueryPart( |
$name)
|
string $name |
the name of the query part to be added |
string $part |
query part string |
Doctrine_Query_Exception if trying to add unknown query part
public function addSqlTableAlias( |
$sqlTableAlias)
|
$sqlTableAlias |
|
string $componentAlias |
the alias for the query component associated with given tableAlias |
Doctrine_Query_Abstract
public function addTableAlias( |
$tableAlias)
|
string $tableAlias |
the table alias to be added |
string $componentAlias |
the alias for the query component associated with given tableAlias |
public function addWhere( |
$where)
|
string $where |
Query WHERE part |
mixed $params |
an array of parameters or a simple scalar |
Doctrine_Query
public function andWhere( |
$where)
|
string $where |
Query WHERE part |
mixed $params |
An array of parameters or a simple scalar |
Doctrine_Query
public function andWhereIn( |
$expr)
|
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 |
Doctrine_Query
public function andWhereNotIn( |
$expr)
|
string $expr |
The operand of the NOT IN |
mixed $params |
An array of parameters or a simple scalar |
Doctrine_Query
public function calculateQueryCacheHash( |
)
|
public function calculateResultCacheHash( |
$params = array())
|
array $params |
protected function clear( |
)
|
public function copySubqueryInfo( |
)
|
|
public function delete( |
$from = null)
|
public function distinct( |
$flag = true)
|
bool $flag |
Whether or not the SELECT is DISTINCT (default true). |
Doctrine_Query
public function execute( |
$params = array())
|
array $params |
|
$hydrationMode |
Doctrine_Collection the root collection
public function expireCache( |
$expire = true)
|
boolean $expire |
whether or not to force cache expiration |
public function expireQueryCache( |
$expire = true)
|
boolean $expire |
whether or not to force cache expiration |
public function expireResultCache( |
$expire = true)
|
boolean $expire |
whether or not to force cache expiration |
public function forUpdate( |
$flag = true)
|
bool $flag |
Whether or not the SELECT is FOR UPDATE (default true). |
Doctrine_Query
public function from( |
$from)
|
public function generateNewSqlTableAlias( |
$oldAlias)
|
$oldAlias |
public function generateNewTableAlias( |
$oldAlias)
|
$oldAlias |
public function generateSqlTableAlias( |
$componentAlias)
|
string $componentAlias |
the component alias to be associated with generated table alias |
string $tableName |
the table name from which to generate the table alias |
public function generateTableAlias( |
$componentAlias)
|
string $componentAlias |
the component alias to be associated with generated table alias |
string $tableName |
the table name from which to generate the table alias |
public function getAliasDeclaration( |
$componentAlias)
|
string $componentAlias |
the component alias the retrieve the declaration from |
public function getAliasMap( |
)
|
public function getCacheDriver( |
)
|
Doctrine_Cache_Interface|boolean|null cache driver
public function getCachedForm( |
$customComponent = null)
|
$customComponent |
public function getComponentAlias( |
$sqlTableAlias)
|
string $sqlTableAlias |
the SQL table alias that identifies the component alias |
public function getConnection( |
)
|
Doctrine_Connection
public function getDql( |
)
|
public function getInheritanceCondition( |
$componentAlias)
|
$componentAlias |
public function getParams( |
$params = array())
|
$params |
public function getParts( |
)
|
public function getQuery( |
$params = array())
|
$params |
public function getQueryCacheDriver( |
)
|
Doctrine_Cache_Interface|boolean|null cache driver
public function getQueryCacheLifeSpan( |
)
|
public function getQueryComponent( |
$componentAlias)
|
string $componentAlias |
the component alias the retrieve the declaration from |
public function getQueryComponents( |
)
|
public function getQueryPart( |
$part)
|
string $part |
query part string |
Doctrine_Query_Abstract this objectDoctrine_Query_Exception if trying to set unknown query part
public function getRawParams( |
)
|
public function getResultCacheDriver( |
)
|
Doctrine_Cache_Interface|boolean|null cache driver
public function getResultCacheLifeSpan( |
)
|
public function getRoot( |
)
|
Doctrine_Table root components table
public function getRootAlias( |
)
|
public function getRootDeclaration( |
)
|
public function getSql( |
$params = array())
|
getSqlQuery().array $params |
(optional) |
public function getSqlParts( |
)
|
abstract public function getSqlQuery( |
$params = array())
|
array $params |
public function getSqlQueryPart( |
$part)
|
string $part |
query part string |
Doctrine_Query_Exception if trying to set unknown query part
public function getSqlTableAlias( |
$componentAlias)
|
Doctrine creates as short identifier aliases as possiblestring $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 |
public function getSqlTableAliasSeed( |
$sqlTableAlias)
|
$sqlTableAlias |
public function getTableAlias( |
$componentAlias)
|
Doctrine creates as short identifier aliases as possiblestring $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 |
public function getTableAliasMap( |
)
|
public function getTableAliasSeed( |
$sqlTableAlias)
|
$sqlTableAlias |
public function getTableAliases( |
)
|
public function getType( |
)
|
Doctrine_Query_Abstract::SELECT but if update() or delete()Doctrine_Query_Abstract::UPDATE and Doctrine_Query_Abstract::DELETE,Doctrine_Query_Abstract::SELECTDoctrine_Query_Abstract::UPDATEDoctrine_Query_Abstract::DELETE
public function getView( |
)
|
Doctrine_View the view associated with this query object
public function groupBy( |
$groupby)
|
string $groupby |
Query GROUP BY part |
Doctrine_Query
public function hasAliasDeclaration( |
$componentAlias)
|
string $componentAlias |
the component alias the retrieve the declaration from |
public function hasSqlTableAlias( |
$sqlTableAlias)
|
$sqlTableAlias |
public function hasTableAlias( |
$sqlTableAlias)
|
$sqlTableAlias |
public function having( |
$having)
|
string $having |
Query HAVING part |
mixed $params |
an array of parameters or a simple scalar |
Doctrine_Query
public function innerJoin( |
$join)
|
string $join |
Query INNER JOIN |
$params |
Doctrine_Query
public function isLimitSubqueryUsed( |
)
|
public function leftJoin( |
$join)
|
string $join |
Query LEFT JOIN |
$params |
Doctrine_Query
public function limit( |
$limit)
|
integer $limit |
limit to be used for limiting the query results |
Doctrine_Query
public function offset( |
$offset)
|
integer $offset |
offset to be used for paginating the query |
Doctrine_Query
public function orWhere( |
$where)
|
string $where |
Query WHERE part |
mixed $params |
An array of parameters or a simple scalar |
Doctrine_Query
public function orWhereIn( |
$expr)
|
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 |
Doctrine_Query
public function orWhereNotIn( |
$expr)
|
string $expr |
The operand of the NOT IN |
mixed $params |
An array of parameters or a simple scalar |
Doctrine_Query
public function orderBy( |
$orderby)
|
string $orderby |
Query ORDER BY part |
Doctrine_Query
abstract public function parseDqlQuery( |
$query)
|
string $query |
query to be parsed |
Doctrine_Query_Abstract this object
public function parseQuery( |
$query)
|
$query |
public function preQuery( |
)
|
Doctrine_Query child classes
public function removeDqlQueryPart( |
$name)
|
string $name |
the name of the query part to be removed |
Doctrine_Query_Exception if trying to remove unknown query part
public function removeQueryPart( |
$name)
|
string $name |
the name of the query part to be removed |
Doctrine_Query_Exception if trying to remove unknown query part
public function removeSqlQueryPart( |
$name)
|
string $name |
the name of the query part to be removed |
Doctrine_Query_Exception if trying to remove unknown query part
public function select( |
$select)
|
string $select |
Query SELECT part |
Doctrine_Query
public function set( |
$key)
|
public function setCacheLifeSpan( |
$timeToLive)
|
integer $timeToLive |
how long the cache entry is valid |
public function setHydrationMode( |
$hydrationMode)
|
$hydrationMode |
public function setOption( |
$name)
|
string $name |
option name |
string $value |
option value |
Doctrine_Query this object
public function setParams( |
array $params = array())
|
array $params |
public function setQueryCacheLifeSpan( |
$timeToLive)
|
integer $timeToLive |
how long the cache entry is valid |
public function setQueryPart( |
$name)
|
string $name |
the name of the query part to be set |
string $part |
query part string |
Doctrine_Query_Exception if trying to set unknown query part
public function setResultCacheLifeSpan( |
$timeToLive)
|
integer $timeToLive |
how long the cache entry is valid (in seconds) |
public function setSqlQueryPart( |
$name)
|
string $name |
the name of the query part to be set |
string $part |
query part string |
Doctrine_Query_Exception if trying to set unknown query part
public function setView( |
)
|
|
public function update( |
$from = null)
|
public function useCache( |
$driver = true)
|
|
cache driver |
integer $timeToLive |
how long the cache entry is valid |
public function useQueryCache( |
$driver = true)
|
|
cache driver |
integer $timeToLive |
how long the cache entry is valid |
public function useResultCache( |
$driver = true)
|
|
cache driver |
integer $timeToLive |
how long the cache entry is valid |
public function where( |
$where)
|
$where |
|
mixed $params |
an array of parameters or a simple scalar |
Doctrine_Query
public function whereIn( |
$expr)
|
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 |
Doctrine_Query
public function whereNotIn( |
$expr)
|
string $expr |
the operand of the NOT IN |
mixed $params |
an array of parameters or a simple scalar |
Doctrine_Query