Commit 64077ac6 authored by beberlei's avatar beberlei

[2.0] Add missing Query::HINT_CUSTOM_OUTPUT_WALKER - it wasn't possible to...

[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
parent cda9c1ba
...@@ -73,8 +73,23 @@ final class Query extends AbstractQuery ...@@ -73,8 +73,23 @@ final class Query extends AbstractQuery
* @var string * @var string
*/ */
const HINT_INCLUDE_META_COLUMNS = 'doctrine.includeMetaColumns'; 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'; 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'; //const HINT_READ_ONLY = 'doctrine.readOnly';
/** /**
......
...@@ -292,6 +292,10 @@ class Parser ...@@ -292,6 +292,10 @@ class Parser
$this->_customTreeWalkers = $customWalkers; $this->_customTreeWalkers = $customWalkers;
} }
if ($customOutputWalker = $this->_query->getHint(Query::HINT_CUSTOM_OUTPUT_WALKER)) {
$this->_customOutputWalker = $customOutputWalker;
}
// Run any custom tree walkers over the AST // Run any custom tree walkers over the AST
if ($this->_customTreeWalkers) { if ($this->_customTreeWalkers) {
$treeWalkerChain = new TreeWalkerChain($this->_query, $this->_parserResult, $this->_queryComponents); $treeWalkerChain = new TreeWalkerChain($this->_query, $this->_parserResult, $this->_queryComponents);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment