| Methods |
public
|
getSQL(): list<string>|string
Gets the SQL query/queries that correspond to this DQL query.
Gets the SQL query/queries that correspond to this DQL query.
Returns
The built sql query or an array of all sql queries.
Implements
|
#
|
public
|
getAST(): SelectStatement|UpdateStatement|DeleteStatement
Returns the corresponding AST for this DQL query.
Returns the corresponding AST for this DQL query.
|
#
|
protected
|
getResultSetMapping(): ResultSetMapping
{@inheritDoc}
|
#
|
private
|
parse(): ParserResult
Parses the DQL query, if necessary, and stores the parser result.
Parses the DQL query, if necessary, and stores the parser result.
Note: Populates $this->_parserResult as a side-effect.
|
#
|
protected
|
_doExecute()
{@inheritDoc}
Returns
The executed database statement that holds
the results, or an integer indicating how
many rows were affected.
Implements
|
#
|
private
|
evictResultSetCache(
AbstractSqlExecutor $executor,
array<string, mixed> $sqlParams,
array<string, Type> $types,
array<string, mixed> $connectionParams,
): void
|
#
|
private
|
evictEntityCacheRegion(): void
Evict entity cache region
Evict entity cache region
|
#
|
private
|
processParameterMappings(array<list<int>> $paramMappings): mixed[][]
Processes query parameter mappings.
Processes query parameter mappings.
Throws
|
#
|
private
|
resolveParameterValue(Parameter $parameter): mixed[]
|
#
|
public
|
setQueryCacheDriver(Cache|null $queryCache): $this
Defines a cache driver to be used for caching queries.
Defines a cache driver to be used for caching queries.
Deprecated
Call {@see setQueryCache()} instead.
Parameters
| $queryCache |
Cache driver.
|
|
#
|
public
|
setQueryCache(?CacheItemPoolInterface $queryCache): $this
Defines a cache driver to be used for caching queries.
Defines a cache driver to be used for caching queries.
|
#
|
public
|
useQueryCache(bool $bool): $this
Defines whether the query should make use of a query cache, if available.
Defines whether the query should make use of a query cache, if available.
|
#
|
public
|
getQueryCacheDriver(): Cache|null
Returns the cache driver used for query caching.
Returns the cache driver used for query caching.
Returns
The cache driver used for query caching or NULL, if
this Query does not use query caching.
|
#
|
public
|
setQueryCacheLifetime(int|null $timeToLive): $this
Defines how long the query cache will be active before expire.
Defines how long the query cache will be active before expire.
Parameters
| $timeToLive |
How long the cache entry is valid.
|
|
#
|
public
|
getQueryCacheLifetime(): ?int
Retrieves the lifetime of resultset cache.
Retrieves the lifetime of resultset cache.
|
#
|
public
|
expireQueryCache(bool $expire = true): $this
Defines if the query cache is active or not.
Defines if the query cache is active or not.
Parameters
| $expire |
Whether or not to force query cache expiration.
|
|
#
|
public
|
getExpireQueryCache(): bool
Retrieves if the query cache is active or not.
Retrieves if the query cache is active or not.
|
#
|
public
|
free(): void
Frees the resources used by the query object.
Frees the resources used by the query object.
Resets Parameters, Parameter Types and Query Hints.
Overrides
|
#
|
public
|
setDQL(string|null $dqlQuery): self
Sets a DQL query string.
|
#
|
public
|
getDQL(): ?string
Returns the DQL query that is represented by this query object.
Returns the DQL query that is represented by this query object.
|
#
|
public
|
getState(): int
Returns the state of this query object
By default the type is Doctrine_ORM_Query_Abstract::STATE_CLEAN but if it…
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.
Returns
|
#
|
public
|
contains(string $dql): bool
Method to check if an arbitrary piece of DQL exists
Method to check if an arbitrary piece of DQL exists
Parameters
| $dql |
Arbitrary piece of DQL to check for.
|
|
#
|
public
|
setFirstResult(int|null $firstResult): $this
Sets the position of the first result to retrieve (the "offset").
Sets the position of the first result to retrieve (the "offset").
Parameters
| $firstResult |
The first result to return.
|
|
#
|
public
|
getFirstResult(): int
Gets the position of the first result the query object was set to retrieve (the "offset").
Returns 0 if {@link…
Gets the position of the first result the query object was set to retrieve (the "offset").
Returns 0 if {@link setFirstResult} was not applied to this query.
Returns
The position of the first result.
|
#
|
public
|
setMaxResults(int|null $maxResults): $this
Sets the maximum number of results to retrieve (the "limit").
Sets the maximum number of results to retrieve (the "limit").
|
#
|
public
|
getMaxResults(): int|null
Gets the maximum number of results the query object was set to retrieve (the "limit").
Returns NULL if {@link…
Gets the maximum number of results the query object was set to retrieve (the "limit").
Returns NULL if {@link setMaxResults} was not applied to this query.
Returns
Maximum number of results.
|
#
|
public
|
iterate(
ArrayCollection<int, Parameter>|array<string, mixed>|null $parameters = null,
string|AbstractQuery::HYDRATE_*|null $hydrationMode = self::HYDRATE_OBJECT,
): IterableResult
Executes the query and returns an IterableResult that can be used to incrementally
iterated over the result.
Executes the query and returns an IterableResult that can be used to incrementally
iterated over the result.
Parameters
| $hydrationMode |
The hydration mode to use.
|
Overrides
|
#
|
public
|
toIterable(iterable $parameters = [], $hydrationMode = self::HYDRATE_OBJECT): iterable
{@inheritDoc}
|
#
|
public
|
setHint($name, $value): self
{@inheritDoc}
Parameters
| $name |
The name of the hint.
|
| $value |
The value of the hint.
|
Overrides
|
#
|
public
|
setHydrationMode($hydrationMode): self
{@inheritDoc}
|
#
|
public
|
setLockMode(LockMode::* $lockMode): $this
Set the lock mode for this Query.
Set the lock mode for this Query.
Throws
|
#
|
public
|
getLockMode(): int|null
Get the current lock mode for this query.
Get the current lock mode for this query.
Returns
The current lock mode of this query or NULL if no specific lock mode is set.
|
#
|
protected
|
getQueryCacheId(): string
Generate a cache id for the query cache - reusing the Result-Cache-Id generator.
Generate a cache id for the query cache - reusing the Result-Cache-Id generator.
|
#
|
protected
|
getHash(): string
Generates a string of currently query to use for the cache second level cache.
Generates a string of currently query to use for the cache second level cache.
Overrides
|
#
|
public
|
__clone()
Cleanup Query resource when clone is called.
Cleanup Query resource when clone is called.
Overrides
|
#
|
| Constants |
public
|
STATE_CLEAN = 1
A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.
A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.
|
#
|
public
|
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…
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
|
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…
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
|
HINT_CACHE_ENABLED = 'doctrine.cache.enabled'
|
#
|
public
|
HINT_CACHE_EVICT = 'doctrine.cache.evict'
|
#
|
public
|
HINT_REFRESH_ENTITY = 'doctrine.refresh.entity'
Internal hint: is set to the proxy entity that is currently triggered for loading
Internal hint: is set to the proxy entity that is currently triggered for loading
|
#
|
public
|
HINT_FORCE_PARTIAL_LOAD = 'doctrine.forcePartialLoad'
The forcePartialLoad query hint forces a particular query to return
partial objects.
The forcePartialLoad query hint forces a particular query to return
partial objects.
|
#
|
public
|
HINT_INCLUDE_META_COLUMNS = 'doctrine.includeMetaColumns'
The includeMetaColumns query hint causes meta columns like foreign keys and
discriminator columns to be selected and…
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
|
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…
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
|
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…
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
|
HINT_READ_ONLY = 'doctrine.readOnly'
Marks queries as creating only read only objects.
Marks queries as creating only read only objects.
If the object retrieved from the query is already in the identity map
then it does not get marked as read only if it wasn't already.
|
#
|
public
|
HINT_INTERNAL_ITERATION = 'doctrine.internal.iteration'
|
#
|
public
|
HINT_LOCK_MODE = 'doctrine.lockMode'
|
#
|