123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545 |
- <?php
- /*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the MIT license. For more information, see
- * <http://www.doctrine-project.org>.
- */
- namespace Doctrine\ORM\Query;
- use Doctrine\ORM\AbstractQuery;
- use Doctrine\ORM\Mapping\ClassMetadata;
- use function array_diff;
- use function array_keys;
- /**
- * An adapter implementation of the TreeWalker interface. The methods in this class
- * are empty. This class exists as convenience for creating tree walkers.
- */
- abstract class TreeWalkerAdapter implements TreeWalker
- {
- /**
- * The original Query.
- *
- * @var AbstractQuery
- */
- private $_query;
- /**
- * The ParserResult of the original query that was produced by the Parser.
- *
- * @var ParserResult
- */
- private $_parserResult;
- /**
- * The query components of the original query (the "symbol table") that was produced by the Parser.
- *
- * @psalm-var array<string, array{
- * metadata: ClassMetadata,
- * parent: string,
- * relation: mixed[],
- * map: mixed,
- * nestingLevel: int,
- * token: array
- * }>
- */
- private $_queryComponents;
- /**
- * {@inheritdoc}
- */
- public function __construct($query, $parserResult, array $queryComponents)
- {
- $this->_query = $query;
- $this->_parserResult = $parserResult;
- $this->_queryComponents = $queryComponents;
- }
- /**
- * {@inheritdoc}
- */
- public function getQueryComponents()
- {
- return $this->_queryComponents;
- }
- /**
- * {@inheritdoc}
- */
- public function setQueryComponent($dqlAlias, array $queryComponent)
- {
- $requiredKeys = ['metadata', 'parent', 'relation', 'map', 'nestingLevel', 'token'];
- if (array_diff($requiredKeys, array_keys($queryComponent))) {
- throw QueryException::invalidQueryComponent($dqlAlias);
- }
- $this->_queryComponents[$dqlAlias] = $queryComponent;
- }
- /**
- * {@inheritDoc}
- */
- protected function _getQueryComponents()
- {
- return $this->_queryComponents;
- }
- /**
- * Retrieves the Query Instance responsible for the current walkers execution.
- *
- * @return AbstractQuery
- */
- protected function _getQuery()
- {
- return $this->_query;
- }
- /**
- * Retrieves the ParserResult.
- *
- * @return ParserResult
- */
- protected function _getParserResult()
- {
- return $this->_parserResult;
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSelectStatement(AST\SelectStatement $AST)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSelectClause($selectClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkFromClause($fromClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkFunction($function)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkOrderByClause($orderByClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkOrderByItem($orderByItem)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkHavingClause($havingClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkJoin($join)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSelectExpression($selectExpression)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkQuantifiedExpression($qExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSubselect($subselect)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSubselectFromClause($subselectFromClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSimpleSelectClause($simpleSelectClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSimpleSelectExpression($simpleSelectExpression)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkAggregateExpression($aggExpression)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkGroupByClause($groupByClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkGroupByItem($groupByItem)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkUpdateStatement(AST\UpdateStatement $AST)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkDeleteStatement(AST\DeleteStatement $AST)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkDeleteClause(AST\DeleteClause $deleteClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkUpdateClause($updateClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkUpdateItem($updateItem)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkWhereClause($whereClause)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkConditionalExpression($condExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkConditionalTerm($condTerm)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkConditionalFactor($factor)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkConditionalPrimary($primary)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkExistsExpression($existsExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkCollectionMemberExpression($collMemberExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkNullComparisonExpression($nullCompExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkInExpression($inExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkInstanceOfExpression($instanceOfExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkLiteral($literal)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkBetweenExpression($betweenExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkLikeExpression($likeExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkStateFieldPathExpression($stateFieldPathExpression)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkComparisonExpression($compExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkInputParameter($inputParam)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkArithmeticExpression($arithmeticExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkArithmeticTerm($term)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkStringPrimary($stringPrimary)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkArithmeticFactor($factor)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkPathExpression($pathExpr)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function walkResultVariable($resultVariable)
- {
- }
- /**
- * {@inheritdoc}
- *
- * @return void
- */
- public function getExecutor($AST)
- {
- }
- }
|