AbstractQuery
public abstract class AbstractQuery
www.doctrine-project.org
Field Summary | |
---|---|
final int | Hydrates an array graph. |
final int | Hydrates an object graph. |
final int | Hydrates a flat, rectangular result set with scalar values. |
final int | Hydrates a single scalar value. |
protected Doctrine\ORM\EntityManager The entity manager used by this query object. | |
protected boolean Boolean value that indicates whether or not expire the result cache. | |
protected array The map of query hints. | |
protected integer The hydration mode. | |
protected array The parameter type map of this query. | |
protected array The parameter map of this query. | |
protected CacheDriver | The locally set cache driver used for caching result sets of this query. |
protected string The id to store the result cache entry under. | |
protected int Result Cache lifetime. | |
protected ResultSetMapping The user-specified ResultSetMapping to use. | |
protected boolean | Boolean flag for whether or not to cache the results of this query. |
Constructor Summary | |
---|---|
AbstractQuery(mixed em, Doctrine\ORM\EntityManager entityManager) Initializes a new instance of a class derived from AbstractQuery. |
Method Summary | |
---|---|
mixed | execute(string params, integer hydrationMode) Executes the query. |
Doctrine\ORM\AbstractQuery | expireResultCache(boolean expire) Defines if the result cache is active or not. |
void | free() Frees the resources used by the query object. |
array | Gets the array of results for the query. |
Doctrine\ORM\EntityManager | Retrieves the associated EntityManager of this Query instance. |
boolean | Retrieves if the resultset cache is active or not. |
mixed | getHint(string name) Gets the value of a query hint. |
integer | Gets the hydration mode currently used by the query. |
mixed | getParameter(mixed key) Gets a query parameter. |
array | Get all defined parameters. |
array | getResult(mixed hydrationMode) Gets the list of results for the query. |
Doctrine\Common\Cache\Cache | Returns the cache driver used for caching result sets. |
integer | Retrieves the lifetime of resultset cache. |
abstract string | getSQL() Gets the SQL query that corresponds to this query object. |
array | Gets the scalar results for the query. |
mixed | getSingleResult(integer hydrationMode) Gets the single result of the query. |
mixed | Gets the single scalar result of the query. |
IterableResult | iterate(array params, integer hydrationMode) Executes the query and returns an IterableResult that can be used to incrementally iterate over the result. |
Doctrine\ORM\AbstractQuery | setHint(string name, mixed value) Sets a query hint. |
Doctrine\ORM\AbstractQuery | setHydrationMode(integer hydrationMode) Defines the processing mode to be used during hydration / result set transformation. |
Doctrine\ORM\AbstractQuery | setParameter(string|integer key, mixed value, string type) Sets a query parameter. |
Doctrine\ORM\AbstractQuery | setParameters(array params, array types) Sets a collection of query parameters. |
Doctrine\ORM\AbstractQuery | setResultCacheDriver(mixed resultCacheDriver, Doctrine\Common\Cache\Cache driver) Defines a cache driver to be used for caching result sets. |
Doctrine\ORM\AbstractQuery | setResultCacheId(string id) Set the result cache id to use to store the result set cache entry. |
Doctrine\ORM\AbstractQuery | setResultCacheLifetime(integer timeToLive) Defines how long the result cache will be active before expire. |
Doctrine\ORM\AbstractQuery | setResultSetMapping(ResultSetMapping rsm) Sets the ResultSetMapping that should be used for hydration. |
This | useResultCache(boolean bool, integer timeToLive, string resultCacheId) Set whether or not to cache the results of this query and if so, for how long and which ID to use for the cache entry. |
public final int HYDRATE_ARRAY = 2
Hydrates an array graph.
public final int HYDRATE_OBJECT = 1
Hydrates an object graph. This is the default behavior.
public final int HYDRATE_SCALAR = 3
Hydrates a flat, rectangular result set with scalar values.
public final int HYDRATE_SINGLE_SCALAR = 4
Hydrates a single scalar value.
protected Doctrine\ORM\EntityManager The entity manager used by this query object. $_em
protected boolean Boolean value that indicates whether or not expire the result cache. $_expireResultCache = false
protected array The map of query hints. $_hints = array()
protected integer The hydration mode. $_hydrationMode = self::HYDRATE_OBJECT
protected array The parameter type map of this query. $_paramTypes = array()
protected array The parameter map of this query. $_params = array()
protected CacheDriver $_resultCacheDriver
The locally set cache driver used for caching result sets of this query.
protected string The id to store the result cache entry under. $_resultCacheId
protected int Result Cache lifetime. $_resultCacheTTL
protected ResultSetMapping The user-specified ResultSetMapping to use. $_resultSetMapping
protected boolean $_useResultCache
Boolean flag for whether or not to cache the results of this query.
public AbstractQuery(mixed em, Doctrine\ORM\EntityManager entityManager)
Initializes a new instance of a class derived from AbstractQuery.
public mixed execute(string params, integer hydrationMode)
Executes the query.
public Doctrine\ORM\AbstractQuery expireResultCache(boolean expire)
Defines if the result cache is active or not.
public void free()
Frees the resources used by the query object.
public array getArrayResult()
Gets the array of results for the query.
Alias for execute(array(), HYDRATE_ARRAY).
public Doctrine\ORM\EntityManager getEntityManager()
Retrieves the associated EntityManager of this Query instance.
public boolean getExpireResultCache()
Retrieves if the resultset cache is active or not.
public mixed getHint(string name)
Gets the value of a query hint. If the hint name is not recognized, FALSE is returned.
public integer getHydrationMode()
Gets the hydration mode currently used by the query.
public mixed getParameter(mixed key)
Gets a query parameter.
public array getParameters()
Get all defined parameters.
public array getResult(mixed hydrationMode)
Gets the list of results for the query.
Alias for execute(array(), $hydrationMode = HYDRATE_OBJECT).
public Doctrine\Common\Cache\Cache getResultCacheDriver()
Returns the cache driver used for caching result sets.
public integer getResultCacheLifetime()
Retrieves the lifetime of resultset cache.
public abstract string getSQL()
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.
public array getScalarResult()
Gets the scalar results for the query.
Alias for execute(array(), HYDRATE_SCALAR).
public mixed getSingleResult(integer hydrationMode)
Gets the single result of the query.
Enforces the presence as well as the uniqueness of the result.
If the result is not unique, a NonUniqueResultException is thrown. If there is no result, a NoResultException is thrown.
public mixed getSingleScalarResult()
Gets the single scalar result of the query.
Alias for getSingleResult(HYDRATE_SINGLE_SCALAR).
public IterableResult iterate(array params, integer hydrationMode)
Executes the query and returns an IterableResult that can be used to incrementally iterate over the result.
public Doctrine\ORM\AbstractQuery setHint(string name, mixed value)
Sets a query hint. If the hint name is not recognized, it is silently ignored.
public Doctrine\ORM\AbstractQuery setHydrationMode(integer hydrationMode)
Defines the processing mode to be used during hydration / result set transformation.
public Doctrine\ORM\AbstractQuery setParameter(string|integer key, mixed value, string type)
Sets a query parameter.
public Doctrine\ORM\AbstractQuery setParameters(array params, array types)
Sets a collection of query parameters.
public Doctrine\ORM\AbstractQuery setResultCacheDriver(mixed resultCacheDriver, Doctrine\Common\Cache\Cache driver)
Defines a cache driver to be used for caching result sets.
public Doctrine\ORM\AbstractQuery setResultCacheId(string id)
Set the result cache id to use to store the result set cache entry. If this is not explicitely set by the developer then a hash is automatically generated for you.
public Doctrine\ORM\AbstractQuery setResultCacheLifetime(integer timeToLive)
Defines how long the result cache will be active before expire.
public Doctrine\ORM\AbstractQuery setResultSetMapping(ResultSetMapping rsm)
Sets the ResultSetMapping that should be used for hydration.
public This useResultCache(boolean bool, integer timeToLive, string resultCacheId)
Set whether or not to cache the results of this query and if so, for how long and which ID to use for the cache entry.
Base contract for ORM queries. Base class for Query and NativeQuery.