diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index fca742663..981869fbb 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -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'; /** diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 92c958c2b..b96453743 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -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);