Doctrine\ORM\AbstractQuery
Base contract for ORM queries. Base class for Query and NativeQuery.
- Author: Benjamin Eberlei <kontakt@beberlei.de>
Synopsis
class AbstractQuery
{
- // constants
- const HYDRATE_OBJECT = 1;
- const HYDRATE_ARRAY = 2;
- const HYDRATE_SCALAR = 3;
- const HYDRATE_SINGLE_SCALAR = 4;
- const HYDRATE_SIMPLEOBJECT = 5;
- // members
- protected ArrayCollection $parameters;
- protected ResultSetMapping $_resultSetMapping;
- protected EntityManager $_em;
- protected array $_hints;
- protected integer $_hydrationMode;
- protected $_queryCacheProfile;
- protected boolean $_expireResultCache;
- protected $_hydrationCacheProfile;
- // methods
- public void __construct()
- public abstract string getSQL()
- public EntityManager getEntityManager()
- public void free()
- public ArrayCollection getParameters()
- public mixed getParameter()
- public AbstractQuery setParameters()
- public AbstractQuery setParameter()
- public array processParameterValue()
- private void convertObjectParameterToScalarValue()
- public AbstractQuery setResultSetMapping()
- public AbstractQuery setHydrationCacheProfile()
- public QueryCacheProfile getHydrationCacheProfile()
- public AbstractQuery setResultCacheProfile()
- public AbstractQuery setResultCacheDriver()
- public Cache getResultCacheDriver()
- public AbstractQuery useResultCache()
- public AbstractQuery setResultCacheLifetime()
- public integer getResultCacheLifetime()
- public AbstractQuery expireResultCache()
- public boolean getExpireResultCache()
- public QueryCacheProfile getQueryCacheProfile()
- public AbstractQuery setFetchMode()
- public AbstractQuery setHydrationMode()
- public integer getHydrationMode()
- public array getResult()
- public array getArrayResult()
- public array getScalarResult()
- public mixed getOneOrNullResult()
- public mixed getSingleResult()
- public mixed getSingleScalarResult()
- public AbstractQuery setHint()
- public mixed getHint()
- public array getHints()
- public IterableResult iterate()
- public mixed execute()
- protected array getHydrationCacheId()
- public AbstractQuery setResultCacheId()
- public string getResultCacheId()
- protected abstract Statement _doExecute()
- public void __clone()
Hierarchy
Extended by
Constants
Name | Value |
---|---|
HYDRATE_OBJECT | 1 |
HYDRATE_ARRAY | 2 |
HYDRATE_SCALAR | 3 |
HYDRATE_SINGLE_SCALAR | 4 |
HYDRATE_SIMPLEOBJECT | 5 |
Members
protected
- $_em — \Doctrine\ORM\EntityManager
- $_expireResultCache — boolean
- $_hints — array
- $_hydrationCacheProfile
- $_hydrationMode — integer
- $_queryCacheProfile
- $_resultSetMapping — Doctrine\ORM\ResultSetMapping
- $parameters — \Doctrine\Common\Collections\ArrayCollection
Methods
private
protected
- _doExecute() — Executes the query and returns a the resulting Statement object.
- getHydrationCacheId() — Get the result cache id to use to store the result set cache entry.
public
- __construct() — Initializes a new instance of a class derived from <tt>AbstractQuery</tt>.
- __clone() — Cleanup Query resource when clone is called.
- execute() — Executes the query.
- expireResultCache() — Defines if the result cache is active or not.
- free() — Frees the resources used by the query object.
- getArrayResult() — Gets the array of results for the query.
- getEntityManager() — Retrieves the associated EntityManager of this Query instance.
- getExpireResultCache() — Retrieves if the resultset cache is active or not.
- getHint() — Gets the value of a query hint. If the hint name is not recognized, FALSE is returned.
- getHints() — Return the key value map of query hints that are currently set.
- getHydrationCacheProfile()
- getHydrationMode() — Gets the hydration mode currently used by the query.
- getOneOrNullResult() — Get exactly one result or null.
- getParameter() — Gets a query parameter.
- getParameters() — Get all defined parameters.
- getQueryCacheProfile()
- getResult() — Gets the list of results for the query.
- getResultCacheDriver() — Returns the cache driver used for caching result sets.
- getResultCacheId() — Get the result cache id to use to store the result set cache entry if set.
- getResultCacheLifetime() — Retrieves the lifetime of resultset cache.
- getSQL() — Gets the SQL query that corresponds to this query object.
- getScalarResult() — Gets the scalar results for the query.
- getSingleResult() — Gets the single result of the query.
- getSingleScalarResult() — Gets the single scalar result of the query.
- iterate() — Executes the query and returns an IterableResult that can be used to incrementally iterate over the result.
- processParameterValue() — Process an individual parameter value
- setFetchMode() — Change the default fetch mode of an association for this query.
- setHint() — Sets a query hint. If the hint name is not recognized, it is silently ignored.
- setHydrationCacheProfile() — Set a cache profile for hydration caching.
- setHydrationMode() — Defines the processing mode to be used during hydration / result set transformation.
- setParameter() — Sets a query parameter.
- setParameters() — Sets a collection of query parameters.
- setResultCacheDriver() — Defines a cache driver to be used for caching result sets and implictly enables caching.
- setResultCacheId() — Set the result cache id to use to store the result set cache entry.
- setResultCacheLifetime() — Defines how long the result cache will be active before expire.
- setResultCacheProfile() — Set a cache profile for the result cache.
- setResultSetMapping() — Sets the ResultSetMapping that should be used for hydration.
- useResultCache() — 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.