AST
9 months ago
Exec
9 months ago
Expr
9 months ago
Filter
9 months ago
Expr.php
9 months ago
FilterCollection.php
9 months ago
Lexer.php
9 months ago
OutputWalker.php
9 months ago
Parameter.php
9 months ago
ParameterTypeInferer.php
9 months ago
Parser.php
9 months ago
ParserResult.php
9 months ago
Printer.php
9 months ago
QueryException.php
9 months ago
QueryExpressionVisitor.php
9 months ago
ResultSetMapping.php
9 months ago
ResultSetMappingBuilder.php
9 months ago
SqlOutputWalker.php
9 months ago
SqlWalker.php
9 months ago
TokenType.php
9 months ago
TreeWalker.php
9 months ago
TreeWalkerAdapter.php
9 months ago
TreeWalkerChain.php
9 months ago
TreeWalkerChainIterator.php
9 months ago
index.php
9 months ago
SqlOutputWalker.php
24 lines
| 1 | <?php |
| 2 | declare (strict_types=1); |
| 3 | namespace MailPoetVendor\Doctrine\ORM\Query; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | use MailPoetVendor\Doctrine\ORM\Query\Exec\PreparedExecutorFinalizer; |
| 6 | use MailPoetVendor\Doctrine\ORM\Query\Exec\SingleSelectSqlFinalizer; |
| 7 | use MailPoetVendor\Doctrine\ORM\Query\Exec\SqlFinalizer; |
| 8 | use LogicException; |
| 9 | class SqlOutputWalker extends SqlWalker implements OutputWalker |
| 10 | { |
| 11 | public function getFinalizer($AST) : SqlFinalizer |
| 12 | { |
| 13 | switch (\true) { |
| 14 | case $AST instanceof AST\SelectStatement: |
| 15 | return new SingleSelectSqlFinalizer($this->createSqlForFinalizer($AST)); |
| 16 | case $AST instanceof AST\UpdateStatement: |
| 17 | return new PreparedExecutorFinalizer($this->createUpdateStatementExecutor($AST)); |
| 18 | case $AST instanceof AST\DeleteStatement: |
| 19 | return new PreparedExecutorFinalizer($this->createDeleteStatementExecutor($AST)); |
| 20 | } |
| 21 | throw new LogicException('Unexpected AST node type'); |
| 22 | } |
| 23 | } |
| 24 |