TreeWalkerAdapter.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. *
  15. * This software consists of voluntary contributions made by many individuals
  16. * and is licensed under the MIT license. For more information, see
  17. * <http://www.doctrine-project.org>.
  18. */
  19. namespace Doctrine\ORM\Query;
  20. /**
  21. * An adapter implementation of the TreeWalker interface. The methods in this class
  22. * are empty. This class exists as convenience for creating tree walkers.
  23. *
  24. * @author Roman Borschel <roman@code-factory.org>
  25. * @since 2.0
  26. */
  27. abstract class TreeWalkerAdapter implements TreeWalker
  28. {
  29. /**
  30. * The original Query.
  31. *
  32. * @var \Doctrine\ORM\AbstractQuery
  33. */
  34. private $_query;
  35. /**
  36. * The ParserResult of the original query that was produced by the Parser.
  37. *
  38. * @var \Doctrine\ORM\Query\ParserResult
  39. */
  40. private $_parserResult;
  41. /**
  42. * The query components of the original query (the "symbol table") that was produced by the Parser.
  43. *
  44. * @var array
  45. */
  46. private $_queryComponents;
  47. /**
  48. * {@inheritdoc}
  49. */
  50. public function __construct($query, $parserResult, array $queryComponents)
  51. {
  52. $this->_query = $query;
  53. $this->_parserResult = $parserResult;
  54. $this->_queryComponents = $queryComponents;
  55. }
  56. /**
  57. * {@inheritdoc}
  58. */
  59. public function getQueryComponents()
  60. {
  61. return $this->_queryComponents;
  62. }
  63. /**
  64. * {@inheritdoc}
  65. */
  66. public function setQueryComponent($dqlAlias, array $queryComponent)
  67. {
  68. $requiredKeys = array('metadata', 'parent', 'relation', 'map', 'nestingLevel', 'token');
  69. if (array_diff($requiredKeys, array_keys($queryComponent))) {
  70. throw QueryException::invalidQueryComponent($dqlAlias);
  71. }
  72. $this->_queryComponents[$dqlAlias] = $queryComponent;
  73. }
  74. /**
  75. * @return array
  76. */
  77. protected function _getQueryComponents()
  78. {
  79. return $this->_queryComponents;
  80. }
  81. /**
  82. * Retrieves the Query Instance responsible for the current walkers execution.
  83. *
  84. * @return \Doctrine\ORM\AbstractQuery
  85. */
  86. protected function _getQuery()
  87. {
  88. return $this->_query;
  89. }
  90. /**
  91. * Retrieves the ParserResult.
  92. *
  93. * @return \Doctrine\ORM\Query\ParserResult
  94. */
  95. protected function _getParserResult()
  96. {
  97. return $this->_parserResult;
  98. }
  99. /**
  100. * {@inheritdoc}
  101. */
  102. public function walkSelectStatement(AST\SelectStatement $AST)
  103. {
  104. }
  105. /**
  106. * {@inheritdoc}
  107. */
  108. public function walkSelectClause($selectClause)
  109. {
  110. }
  111. /**
  112. * {@inheritdoc}
  113. */
  114. public function walkFromClause($fromClause)
  115. {
  116. }
  117. /**
  118. * {@inheritdoc}
  119. */
  120. public function walkFunction($function)
  121. {
  122. }
  123. /**
  124. * {@inheritdoc}
  125. */
  126. public function walkOrderByClause($orderByClause)
  127. {
  128. }
  129. /**
  130. * {@inheritdoc}
  131. */
  132. public function walkOrderByItem($orderByItem)
  133. {
  134. }
  135. /**
  136. * {@inheritdoc}
  137. */
  138. public function walkHavingClause($havingClause)
  139. {
  140. }
  141. /**
  142. * {@inheritdoc}
  143. */
  144. public function walkJoin($join)
  145. {
  146. }
  147. /**
  148. * {@inheritdoc}
  149. */
  150. public function walkSelectExpression($selectExpression)
  151. {
  152. }
  153. /**
  154. * {@inheritdoc}
  155. */
  156. public function walkQuantifiedExpression($qExpr)
  157. {
  158. }
  159. /**
  160. * {@inheritdoc}
  161. */
  162. public function walkSubselect($subselect)
  163. {
  164. }
  165. /**
  166. * {@inheritdoc}
  167. */
  168. public function walkSubselectFromClause($subselectFromClause)
  169. {
  170. }
  171. /**
  172. * {@inheritdoc}
  173. */
  174. public function walkSimpleSelectClause($simpleSelectClause)
  175. {
  176. }
  177. /**
  178. * {@inheritdoc}
  179. */
  180. public function walkSimpleSelectExpression($simpleSelectExpression)
  181. {
  182. }
  183. /**
  184. * {@inheritdoc}
  185. */
  186. public function walkAggregateExpression($aggExpression)
  187. {
  188. }
  189. /**
  190. * {@inheritdoc}
  191. */
  192. public function walkGroupByClause($groupByClause)
  193. {
  194. }
  195. /**
  196. * {@inheritdoc}
  197. */
  198. public function walkGroupByItem($groupByItem)
  199. {
  200. }
  201. /**
  202. * {@inheritdoc}
  203. */
  204. public function walkUpdateStatement(AST\UpdateStatement $AST)
  205. {
  206. }
  207. /**
  208. * {@inheritdoc}
  209. */
  210. public function walkDeleteStatement(AST\DeleteStatement $AST)
  211. {
  212. }
  213. /**
  214. * {@inheritdoc}
  215. */
  216. public function walkDeleteClause(AST\DeleteClause $deleteClause)
  217. {
  218. }
  219. /**
  220. * {@inheritdoc}
  221. */
  222. public function walkUpdateClause($updateClause)
  223. {
  224. }
  225. /**
  226. * {@inheritdoc}
  227. */
  228. public function walkUpdateItem($updateItem)
  229. {
  230. }
  231. /**
  232. * {@inheritdoc}
  233. */
  234. public function walkWhereClause($whereClause)
  235. {
  236. }
  237. /**
  238. * {@inheritdoc}
  239. */
  240. public function walkConditionalExpression($condExpr)
  241. {
  242. }
  243. /**
  244. * {@inheritdoc}
  245. */
  246. public function walkConditionalTerm($condTerm)
  247. {
  248. }
  249. /**
  250. * {@inheritdoc}
  251. */
  252. public function walkConditionalFactor($factor)
  253. {
  254. }
  255. /**
  256. * {@inheritdoc}
  257. */
  258. public function walkConditionalPrimary($primary)
  259. {
  260. }
  261. /**
  262. * {@inheritdoc}
  263. */
  264. public function walkExistsExpression($existsExpr)
  265. {
  266. }
  267. /**
  268. * {@inheritdoc}
  269. */
  270. public function walkCollectionMemberExpression($collMemberExpr)
  271. {
  272. }
  273. /**
  274. * {@inheritdoc}
  275. */
  276. public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr)
  277. {
  278. }
  279. /**
  280. * {@inheritdoc}
  281. */
  282. public function walkNullComparisonExpression($nullCompExpr)
  283. {
  284. }
  285. /**
  286. * {@inheritdoc}
  287. */
  288. public function walkInExpression($inExpr)
  289. {
  290. }
  291. /**
  292. * {@inheritdoc}
  293. */
  294. function walkInstanceOfExpression($instanceOfExpr)
  295. {
  296. }
  297. /**
  298. * {@inheritdoc}
  299. */
  300. public function walkLiteral($literal)
  301. {
  302. }
  303. /**
  304. * {@inheritdoc}
  305. */
  306. public function walkBetweenExpression($betweenExpr)
  307. {
  308. }
  309. /**
  310. * {@inheritdoc}
  311. */
  312. public function walkLikeExpression($likeExpr)
  313. {
  314. }
  315. /**
  316. * {@inheritdoc}
  317. */
  318. public function walkStateFieldPathExpression($stateFieldPathExpression)
  319. {
  320. }
  321. /**
  322. * {@inheritdoc}
  323. */
  324. public function walkComparisonExpression($compExpr)
  325. {
  326. }
  327. /**
  328. * {@inheritdoc}
  329. */
  330. public function walkInputParameter($inputParam)
  331. {
  332. }
  333. /**
  334. * {@inheritdoc}
  335. */
  336. public function walkArithmeticExpression($arithmeticExpr)
  337. {
  338. }
  339. /**
  340. * {@inheritdoc}
  341. */
  342. public function walkArithmeticTerm($term)
  343. {
  344. }
  345. /**
  346. * {@inheritdoc}
  347. */
  348. public function walkStringPrimary($stringPrimary)
  349. {
  350. }
  351. /**
  352. * {@inheritdoc}
  353. */
  354. public function walkArithmeticFactor($factor)
  355. {
  356. }
  357. /**
  358. * {@inheritdoc}
  359. */
  360. public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
  361. {
  362. }
  363. /**
  364. * {@inheritdoc}
  365. */
  366. public function walkPathExpression($pathExpr)
  367. {
  368. }
  369. /**
  370. * {@inheritdoc}
  371. */
  372. public function walkResultVariable($resultVariable)
  373. {
  374. }
  375. /**
  376. * {@inheritdoc}
  377. */
  378. public function getExecutor($AST)
  379. {
  380. }
  381. }