[2.0] Add missing Query::HINT_CUSTOM_OUTPUT_WALKER - it wasn't possible to change the output walker before without extending and overwriting one large method in Query
This commit is contained in:
parent
cda9c1babd
commit
64077ac65f
2 changed files with 20 additions and 1 deletions
|
@ -73,8 +73,23 @@ final class Query extends AbstractQuery
|
|||
* @var string
|
||||
*/
|
||||
const HINT_INCLUDE_META_COLUMNS = 'doctrine.includeMetaColumns';
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const HINT_CUSTOM_TREE_WALKERS = 'doctrine.customTreeWalkers';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const HINT_CUSTOM_OUTPUT_WALKER = 'doctrine.customOutputWalker';
|
||||
|
||||
//const HINT_READ_ONLY = 'doctrine.readOnly';
|
||||
|
||||
/**
|
||||
|
|
|
@ -292,6 +292,10 @@ class Parser
|
|||
$this->_customTreeWalkers = $customWalkers;
|
||||
}
|
||||
|
||||
if ($customOutputWalker = $this->_query->getHint(Query::HINT_CUSTOM_OUTPUT_WALKER)) {
|
||||
$this->_customOutputWalker = $customOutputWalker;
|
||||
}
|
||||
|
||||
// Run any custom tree walkers over the AST
|
||||
if ($this->_customTreeWalkers) {
|
||||
$treeWalkerChain = new TreeWalkerChain($this->_query, $this->_parserResult, $this->_queryComponents);
|
||||
|
|
Loading…
Add table
Reference in a new issue