Class:Query - Superclass: AbstractQuery AbstractQuery
⌊ Query
public final class Query
extends AbstractQuery
www.doctrine-project.org
Field Summary | |
---|---|
final string | A string with a class name that implements Doctrine\ORM\Query\TreeWalker and is used for generating the target SQL from any DQL AST tree. |
final string | An array of class names that implement Doctrine\ORM\Query\TreeWalker and are iterated and executed after the DQL has been parsed into an AST. |
final string | The forcePartialLoad query hint forces a particular query to return partial objects. |
final string | The includeMetaColumns query hint causes meta columns like foreign keys and discriminator columns to be selected and returned as part of the query result. |
final string | |
final string | The refresh hint turns any query into a refresh query with the result that any local changes in entities are overridden with the fetched values. |
final int | A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts. |
final int | A query object is in state DIRTY when it has DQL parts that have not yet been parsed/processed. |
Fields inherited from Doctrine\ORM\AbstractQuery | |
---|---|
HYDRATE_ARRAY, HYDRATE_OBJECT, HYDRATE_SCALAR, HYDRATE_SINGLE_SCALAR, _em, _expireResultCache, _hints, _hydrationMode, _paramTypes, _params, _resultCacheDriver, _resultCacheId, _resultCacheTTL, _resultSetMapping, _useResultCache |
Method Summary | |
---|---|
boolean | contains(string dql) Method to check if an arbitrary piece of DQL exists |
Query | expireQueryCache(boolean expire) Defines if the query cache is active or not. |
void | free() |
Doctrine\ORM\Query\AST\SelectStatement | getAST() Returns the corresponding AST for this DQL query. |
string | getDQL() Returns the DQL query that is represented by this query object. |
bool | Retrieves if the query cache is active or not. |
integer | Gets the position of the first result the query object was set to retrieve (the "offset"). |
integer | Gets the maximum number of results the query object was set to retrieve (the "limit"). |
CacheDriver | Returns the cache driver used for query caching. |
int | Retrieves the lifetime of resultset cache. |
mixed | getSQL() Gets the SQL query/queries that correspond to this DQL query. |
integer | getState() Returns the state of this query object By default the type is Doctrine_ORM_Query_Abstract::STATE_CLEAN but if it appears any unprocessed DQL part, it is switched to Doctrine_ORM_Query_Abstract::STATE_DIRTY. |
IterableResult | iterate(array params, integer hydrationMode) Executes the query and returns an IterableResult that can be used to incrementally iterated over the result. |
Doctrine\ORM\AbstractQuery | setDQL(string dqlQuery) Sets a DQL query string. |
Query | setFirstResult(integer firstResult) Sets the position of the first result to retrieve (the "offset"). |
Doctrine\ORM\AbstractQuery | setHint(string name, mixed value) {@inheritdoc} |
Doctrine\ORM\AbstractQuery | setHydrationMode(integer hydrationMode) {@inheritdoc} |
Query | setMaxResults(integer maxResults) Sets the maximum number of results to retrieve (the "limit"). |
Query | setQueryCacheDriver(mixed queryCache, Doctrine_Cache_Interface|null driver) Defines a cache driver to be used for caching queries. |
Query | setQueryCacheLifetime(integer timeToLive) Defines how long the query cache will be active before expire. |
@return | useQueryCache(boolean bool) Defines whether the query should make use of a query cache, if available. |
Methods inherited from Doctrine\ORM\AbstractQuery | |
---|---|
execute, expireResultCache, free, getArrayResult, getEntityManager, getExpireResultCache, getHint, getHydrationMode, getParameter, getParameters, getResult, getResultCacheDriver, getResultCacheLifetime, getSQL, getScalarResult, getSingleResult, getSingleScalarResult, iterate, setHint, setHydrationMode, setParameter, setParameters, setResultCacheDriver, setResultCacheId, setResultCacheLifetime, setResultSetMapping, useResultCache |
public final string HINT_CUSTOM_OUTPUT_WALKER = 'doctrine.customOutputWalker'
A string with a class name that implements Doctrine\ORM\Query\TreeWalker and is used for generating the target SQL from any DQL AST tree.
public final string HINT_CUSTOM_TREE_WALKERS = 'doctrine.customTreeWalkers'
An array of class names that implement Doctrine\ORM\Query\TreeWalker and are iterated and executed after the DQL has been parsed into an AST.
public final string HINT_FORCE_PARTIAL_LOAD = 'doctrine.forcePartialLoad'
The forcePartialLoad query hint forces a particular query to return partial objects.
public final string HINT_INCLUDE_META_COLUMNS = 'doctrine.includeMetaColumns'
The includeMetaColumns query hint causes meta columns like foreign keys and discriminator columns to be selected and returned as part of the query result.
This hint does only apply to non-object queries.
public final string HINT_INTERNAL_ITERATION = 'doctrine.internal.iteration'
public final string HINT_REFRESH = 'doctrine.refresh'
The refresh hint turns any query into a refresh query with the result that any local changes in entities are overridden with the fetched values.
public final int STATE_CLEAN = 1
A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.
public final int STATE_DIRTY = 2
A query object is in state DIRTY when it has DQL parts that have not yet been parsed/processed. This is automatically defined as DIRTY when addDqlQueryPart is called.
public boolean contains(string dql)
Method to check if an arbitrary piece of DQL exists
public Query expireQueryCache(boolean expire)
Defines if the query cache is active or not.
public void free()
public Doctrine\ORM\Query\AST\SelectStatement getAST()
Returns the corresponding AST for this DQL query.
public string getDQL()
Returns the DQL query that is represented by this query object.
public bool getExpireQueryCache()
Retrieves if the query cache is active or not.
public integer getFirstResult()
Gets the position of the first result the query object was set to retrieve (the "offset").
Returns NULL if setFirstResult
was not applied to this query.
public integer getMaxResults()
Gets the maximum number of results the query object was set to retrieve (the "limit").
Returns NULL if setMaxResults
was not applied to this query.
public CacheDriver getQueryCacheDriver()
Returns the cache driver used for query caching.
public int getQueryCacheLifetime()
Retrieves the lifetime of resultset cache.
public mixed getSQL()
Gets the SQL query/queries that correspond to this DQL query.
public integer getState()
Returns the state of this query object By default the type is Doctrine_ORM_Query_Abstract::STATE_CLEAN but if it appears any unprocessed DQL part, it is switched to Doctrine_ORM_Query_Abstract::STATE_DIRTY.
public IterableResult iterate(array params, integer hydrationMode)
Executes the query and returns an IterableResult that can be used to incrementally iterated over the result.
public Doctrine\ORM\AbstractQuery setDQL(string dqlQuery)
Sets a DQL query string.
public Query setFirstResult(integer firstResult)
Sets the position of the first result to retrieve (the "offset").
public Doctrine\ORM\AbstractQuery setHint(string name, mixed value)
public Doctrine\ORM\AbstractQuery setHydrationMode(integer hydrationMode)
public Query setMaxResults(integer maxResults)
Sets the maximum number of results to retrieve (the "limit").
public Query setQueryCacheDriver(mixed queryCache, Doctrine_Cache_Interface|null driver)
Defines a cache driver to be used for caching queries.
public Query setQueryCacheLifetime(integer timeToLive)
Defines how long the query cache will be active before expire.
public @return useQueryCache(boolean bool)
Defines whether the query should make use of a query cache, if available.
A Query object represents a DQL query.