Complex classes like SqlWalker often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use SqlWalker, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 42 | class SqlWalker implements TreeWalker |
||
| 43 | { |
||
| 44 | /** |
||
| 45 | * @var string |
||
| 46 | */ |
||
| 47 | const HINT_DISTINCT = 'doctrine.distinct'; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @var ResultSetMapping |
||
| 51 | */ |
||
| 52 | private $rsm; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Counter for generating unique column aliases. |
||
| 56 | * |
||
| 57 | * @var integer |
||
| 58 | */ |
||
| 59 | private $aliasCounter = 0; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Counter for generating unique table aliases. |
||
| 63 | * |
||
| 64 | * @var integer |
||
| 65 | */ |
||
| 66 | private $tableAliasCounter = 0; |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Counter for generating unique scalar result. |
||
| 70 | * |
||
| 71 | * @var integer |
||
| 72 | */ |
||
| 73 | private $scalarResultCounter = 1; |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Counter for generating unique parameter indexes. |
||
| 77 | * |
||
| 78 | * @var integer |
||
| 79 | */ |
||
| 80 | private $sqlParamIndex = 0; |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Counter for generating indexes. |
||
| 84 | * |
||
| 85 | * @var integer |
||
| 86 | */ |
||
| 87 | private $newObjectCounter = 0; |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @var ParserResult |
||
| 91 | */ |
||
| 92 | private $parserResult; |
||
| 93 | |||
| 94 | /** |
||
| 95 | * @var \Doctrine\ORM\EntityManager |
||
| 96 | */ |
||
| 97 | private $em; |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @var \Doctrine\DBAL\Connection |
||
| 101 | */ |
||
| 102 | private $conn; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * @var \Doctrine\ORM\AbstractQuery |
||
| 106 | */ |
||
| 107 | private $query; |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @var array |
||
| 111 | */ |
||
| 112 | private $tableAliasMap = array(); |
||
| 113 | |||
| 114 | /** |
||
| 115 | * Map from result variable names to their SQL column alias names. |
||
| 116 | * |
||
| 117 | * @var array |
||
| 118 | */ |
||
| 119 | private $scalarResultAliasMap = array(); |
||
| 120 | |||
| 121 | /** |
||
| 122 | * Map from Table-Alias + Column-Name to OrderBy-Direction. |
||
| 123 | * |
||
| 124 | * @var array |
||
| 125 | */ |
||
| 126 | private $orderedColumnsMap = array(); |
||
| 127 | |||
| 128 | /** |
||
| 129 | * Map from DQL-Alias + Field-Name to SQL Column Alias. |
||
| 130 | * |
||
| 131 | * @var array |
||
| 132 | */ |
||
| 133 | private $scalarFields = array(); |
||
| 134 | |||
| 135 | /** |
||
| 136 | * Map of all components/classes that appear in the DQL query. |
||
| 137 | * |
||
| 138 | * @var array |
||
| 139 | */ |
||
| 140 | private $queryComponents; |
||
| 141 | |||
| 142 | /** |
||
| 143 | * A list of classes that appear in non-scalar SelectExpressions. |
||
| 144 | * |
||
| 145 | * @var array |
||
| 146 | */ |
||
| 147 | private $selectedClasses = array(); |
||
| 148 | |||
| 149 | /** |
||
| 150 | * The DQL alias of the root class of the currently traversed query. |
||
| 151 | * |
||
| 152 | * @var array |
||
| 153 | */ |
||
| 154 | private $rootAliases = array(); |
||
| 155 | |||
| 156 | /** |
||
| 157 | * Flag that indicates whether to generate SQL table aliases in the SQL. |
||
| 158 | * These should only be generated for SELECT queries, not for UPDATE/DELETE. |
||
| 159 | * |
||
| 160 | * @var boolean |
||
| 161 | */ |
||
| 162 | private $useSqlTableAliases = true; |
||
| 163 | |||
| 164 | /** |
||
| 165 | * The database platform abstraction. |
||
| 166 | * |
||
| 167 | * @var \Doctrine\DBAL\Platforms\AbstractPlatform |
||
| 168 | */ |
||
| 169 | private $platform; |
||
| 170 | |||
| 171 | /** |
||
| 172 | * The quote strategy. |
||
| 173 | * |
||
| 174 | * @var \Doctrine\ORM\Mapping\QuoteStrategy |
||
| 175 | */ |
||
| 176 | private $quoteStrategy; |
||
| 177 | |||
| 178 | /** |
||
| 179 | * {@inheritDoc} |
||
| 180 | */ |
||
| 181 | 684 | public function __construct($query, $parserResult, array $queryComponents) |
|
| 192 | |||
| 193 | /** |
||
| 194 | * Gets the Query instance used by the walker. |
||
| 195 | * |
||
| 196 | * @return Query. |
||
|
|
|||
| 197 | */ |
||
| 198 | public function getQuery() |
||
| 202 | |||
| 203 | /** |
||
| 204 | * Gets the Connection used by the walker. |
||
| 205 | * |
||
| 206 | * @return \Doctrine\DBAL\Connection |
||
| 207 | */ |
||
| 208 | 35 | public function getConnection() |
|
| 212 | |||
| 213 | /** |
||
| 214 | * Gets the EntityManager used by the walker. |
||
| 215 | * |
||
| 216 | * @return \Doctrine\ORM\EntityManager |
||
| 217 | */ |
||
| 218 | 23 | public function getEntityManager() |
|
| 222 | |||
| 223 | /** |
||
| 224 | * Gets the information about a single query component. |
||
| 225 | * |
||
| 226 | * @param string $dqlAlias The DQL alias. |
||
| 227 | * |
||
| 228 | * @return array |
||
| 229 | */ |
||
| 230 | 18 | public function getQueryComponent($dqlAlias) |
|
| 234 | |||
| 235 | /** |
||
| 236 | * {@inheritdoc} |
||
| 237 | */ |
||
| 238 | public function getQueryComponents() |
||
| 242 | |||
| 243 | /** |
||
| 244 | * {@inheritdoc} |
||
| 245 | */ |
||
| 246 | 1 | public function setQueryComponent($dqlAlias, array $queryComponent) |
|
| 256 | |||
| 257 | /** |
||
| 258 | * {@inheritdoc} |
||
| 259 | */ |
||
| 260 | 678 | public function getExecutor($AST) |
|
| 281 | |||
| 282 | /** |
||
| 283 | * Generates a unique, short SQL table alias. |
||
| 284 | * |
||
| 285 | * @param string $tableName Table name |
||
| 286 | * @param string $dqlAlias The DQL alias. |
||
| 287 | * |
||
| 288 | * @return string Generated table alias. |
||
| 289 | */ |
||
| 290 | 630 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
|
| 301 | |||
| 302 | /** |
||
| 303 | * Forces the SqlWalker to use a specific alias for a table name, rather than |
||
| 304 | * generating an alias on its own. |
||
| 305 | * |
||
| 306 | * @param string $tableName |
||
| 307 | * @param string $alias |
||
| 308 | * @param string $dqlAlias |
||
| 309 | * |
||
| 310 | * @return string |
||
| 311 | */ |
||
| 312 | 65 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
|
| 320 | |||
| 321 | /** |
||
| 322 | * Gets an SQL column alias for a column name. |
||
| 323 | * |
||
| 324 | * @param string $columnName |
||
| 325 | * |
||
| 326 | * @return string |
||
| 327 | */ |
||
| 328 | 618 | public function getSQLColumnAlias($columnName) |
|
| 332 | |||
| 333 | /** |
||
| 334 | * Generates the SQL JOINs that are necessary for Class Table Inheritance |
||
| 335 | * for the given class. |
||
| 336 | * |
||
| 337 | * @param ClassMetadata $class The class for which to generate the joins. |
||
| 338 | * @param string $dqlAlias The DQL alias of the class. |
||
| 339 | * |
||
| 340 | * @return string The SQL. |
||
| 341 | */ |
||
| 342 | 93 | private function _generateClassTableInheritanceJoins($class, $dqlAlias) |
|
| 394 | |||
| 395 | /** |
||
| 396 | * @return string |
||
| 397 | */ |
||
| 398 | 611 | private function _generateOrderedCollectionOrderByItems() |
|
| 432 | |||
| 433 | /** |
||
| 434 | * Generates a discriminator column SQL condition for the class with the given DQL alias. |
||
| 435 | * |
||
| 436 | * @param array $dqlAliases List of root DQL aliases to inspect for discriminator restrictions. |
||
| 437 | * |
||
| 438 | * @return string |
||
| 439 | */ |
||
| 440 | 672 | private function _generateDiscriminatorColumnConditionSQL(array $dqlAliases) |
|
| 441 | { |
||
| 442 | 672 | $sqlParts = array(); |
|
| 443 | |||
| 444 | 672 | foreach ($dqlAliases as $dqlAlias) { |
|
| 445 | 672 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
|
| 446 | |||
| 447 | 672 | if ( ! $class->isInheritanceTypeSingleTable()) continue; |
|
| 448 | |||
| 449 | 37 | $conn = $this->em->getConnection(); |
|
| 450 | 37 | $values = array(); |
|
| 451 | |||
| 452 | 37 | if ($class->discriminatorValue !== null) { // discriminators can be 0 |
|
| 453 | 18 | $values[] = $conn->quote($class->discriminatorValue); |
|
| 454 | } |
||
| 455 | |||
| 456 | 37 | foreach ($class->subClasses as $subclassName) { |
|
| 457 | 27 | $values[] = $conn->quote($this->em->getClassMetadata($subclassName)->discriminatorValue); |
|
| 458 | } |
||
| 459 | |||
| 460 | 37 | $sqlTableAlias = ($this->useSqlTableAliases) |
|
| 461 | 32 | ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' |
|
| 462 | 37 | : ''; |
|
| 463 | |||
| 464 | 37 | $sqlParts[] = $sqlTableAlias . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; |
|
| 465 | } |
||
| 466 | |||
| 467 | 672 | $sql = implode(' AND ', $sqlParts); |
|
| 468 | |||
| 469 | 672 | return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
| 470 | } |
||
| 471 | |||
| 472 | /** |
||
| 473 | * Generates the filter SQL for a given entity and table alias. |
||
| 474 | * |
||
| 475 | * @param ClassMetadata $targetEntity Metadata of the target entity. |
||
| 476 | * @param string $targetTableAlias The table alias of the joined/selected table. |
||
| 477 | * |
||
| 478 | * @return string The SQL query part to add to a query. |
||
| 479 | */ |
||
| 480 | 318 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
|
| 516 | |||
| 517 | /** |
||
| 518 | * {@inheritdoc} |
||
| 519 | */ |
||
| 520 | 618 | public function walkSelectStatement(AST\SelectStatement $AST) |
|
| 573 | |||
| 574 | /** |
||
| 575 | * {@inheritdoc} |
||
| 576 | */ |
||
| 577 | 25 | public function walkUpdateStatement(AST\UpdateStatement $AST) |
|
| 585 | |||
| 586 | /** |
||
| 587 | * {@inheritdoc} |
||
| 588 | */ |
||
| 589 | 37 | public function walkDeleteStatement(AST\DeleteStatement $AST) |
|
| 597 | |||
| 598 | /** |
||
| 599 | * Walks down an IdentificationVariable AST node, thereby generating the appropriate SQL. |
||
| 600 | * This one differs of ->walkIdentificationVariable() because it generates the entity identifiers. |
||
| 601 | * |
||
| 602 | * @param string $identVariable |
||
| 603 | * |
||
| 604 | * @return string |
||
| 605 | */ |
||
| 606 | 2 | public function walkEntityIdentificationVariable($identVariable) |
|
| 618 | |||
| 619 | /** |
||
| 620 | * Walks down an IdentificationVariable (no AST node associated), thereby generating the SQL. |
||
| 621 | * |
||
| 622 | * @param string $identificationVariable |
||
| 623 | * @param string $fieldName |
||
| 624 | * |
||
| 625 | * @return string The SQL. |
||
| 626 | */ |
||
| 627 | 418 | public function walkIdentificationVariable($identificationVariable, $fieldName = null) |
|
| 640 | |||
| 641 | /** |
||
| 642 | * {@inheritdoc} |
||
| 643 | */ |
||
| 644 | 487 | public function walkPathExpression($pathExpr) |
|
| 696 | |||
| 697 | /** |
||
| 698 | * {@inheritdoc} |
||
| 699 | */ |
||
| 700 | 618 | public function walkSelectClause($selectClause) |
|
| 701 | { |
||
| 702 | 618 | $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 703 | 618 | $sqlSelectExpressions = array_filter(array_map(array($this, 'walkSelectExpression'), $selectClause->selectExpressions)); |
|
| 704 | |||
| 705 | 618 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
|
| 706 | 1 | $this->query->setHint(self::HINT_DISTINCT, true); |
|
| 707 | } |
||
| 708 | |||
| 709 | 618 | $addMetaColumns = ! $this->query->getHint(Query::HINT_FORCE_PARTIAL_LOAD) && |
|
| 710 | 455 | $this->query->getHydrationMode() == Query::HYDRATE_OBJECT |
|
| 711 | || |
||
| 712 | 289 | $this->query->getHydrationMode() != Query::HYDRATE_OBJECT && |
|
| 713 | 618 | $this->query->getHint(Query::HINT_INCLUDE_META_COLUMNS); |
|
| 714 | |||
| 715 | 618 | foreach ($this->selectedClasses as $selectedClass) { |
|
| 716 | 482 | $class = $selectedClass['class']; |
|
| 717 | 482 | $dqlAlias = $selectedClass['dqlAlias']; |
|
| 718 | 482 | $resultAlias = $selectedClass['resultAlias']; |
|
| 719 | |||
| 720 | // Register as entity or joined entity result |
||
| 721 | 482 | if ($this->queryComponents[$dqlAlias]['relation'] === null) { |
|
| 722 | 482 | $this->rsm->addEntityResult($class->name, $dqlAlias, $resultAlias); |
|
| 723 | } else { |
||
| 724 | 158 | $this->rsm->addJoinedEntityResult( |
|
| 725 | 158 | $class->name, |
|
| 726 | $dqlAlias, |
||
| 727 | 158 | $this->queryComponents[$dqlAlias]['parent'], |
|
| 728 | 158 | $this->queryComponents[$dqlAlias]['relation']['fieldName'] |
|
| 729 | ); |
||
| 730 | } |
||
| 731 | |||
| 732 | 482 | if ($class->isInheritanceTypeSingleTable() || $class->isInheritanceTypeJoined()) { |
|
| 733 | // Add discriminator columns to SQL |
||
| 734 | 88 | $rootClass = $this->em->getClassMetadata($class->rootEntityName); |
|
| 735 | 88 | $tblAlias = $this->getSQLTableAlias($rootClass->getTableName(), $dqlAlias); |
|
| 736 | 88 | $discrColumn = $rootClass->discriminatorColumn; |
|
| 737 | 88 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
|
| 738 | |||
| 739 | 88 | $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
| 740 | |||
| 741 | 88 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
|
| 742 | 88 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName'], false, $discrColumn['type']); |
|
| 743 | } |
||
| 744 | |||
| 745 | // Add foreign key columns to SQL, if necessary |
||
| 746 | 482 | if ( ! $addMetaColumns && ! $class->containsForeignIdentifier) { |
|
| 747 | 181 | continue; |
|
| 748 | } |
||
| 749 | |||
| 750 | // Add foreign key columns of class and also parent classes |
||
| 751 | 351 | foreach ($class->associationMappings as $assoc) { |
|
| 752 | 313 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
| 753 | 265 | continue; |
|
| 754 | 281 | } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
| 755 | continue; |
||
| 756 | } |
||
| 757 | |||
| 758 | 281 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
|
| 759 | 281 | $isIdentifier = (isset($assoc['id']) && $assoc['id'] === true); |
|
| 760 | 281 | $owningClass = (isset($assoc['inherited'])) ? $this->em->getClassMetadata($assoc['inherited']) : $class; |
|
| 761 | 281 | $sqlTableAlias = $this->getSQLTableAlias($owningClass->getTableName(), $dqlAlias); |
|
| 762 | |||
| 763 | 281 | foreach ($assoc['joinColumns'] as $joinColumn) { |
|
| 764 | 281 | $columnName = $joinColumn['name']; |
|
| 765 | 281 | $columnAlias = $this->getSQLColumnAlias($columnName); |
|
| 766 | 281 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
|
| 767 | |||
| 768 | 281 | $sqlSelectExpressions[] = $sqlTableAlias . '.' . $columnName . ' AS ' . $columnAlias; |
|
| 769 | |||
| 770 | 281 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $isIdentifier, $columnType); |
|
| 771 | } |
||
| 772 | } |
||
| 773 | |||
| 774 | // Add foreign key columns to SQL, if necessary |
||
| 775 | 351 | if ( ! $addMetaColumns) { |
|
| 776 | 8 | continue; |
|
| 777 | } |
||
| 778 | |||
| 779 | // Add foreign key columns of subclasses |
||
| 780 | 346 | foreach ($class->subClasses as $subClassName) { |
|
| 781 | 30 | $subClass = $this->em->getClassMetadata($subClassName); |
|
| 782 | 30 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
|
| 783 | |||
| 784 | 30 | foreach ($subClass->associationMappings as $assoc) { |
|
| 785 | // Skip if association is inherited |
||
| 786 | 26 | if (isset($assoc['inherited'])) continue; |
|
| 787 | |||
| 788 | 15 | if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { |
|
| 789 | 13 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
|
| 790 | |||
| 791 | 13 | foreach ($assoc['joinColumns'] as $joinColumn) { |
|
| 792 | 13 | $columnName = $joinColumn['name']; |
|
| 793 | 13 | $columnAlias = $this->getSQLColumnAlias($columnName); |
|
| 794 | 13 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
|
| 795 | |||
| 796 | 13 | $sqlSelectExpressions[] = $sqlTableAlias . '.' . $columnName . ' AS ' . $columnAlias; |
|
| 797 | |||
| 798 | 346 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $subClass->isIdentifier($columnName), $columnType); |
|
| 799 | } |
||
| 800 | } |
||
| 801 | } |
||
| 802 | } |
||
| 803 | } |
||
| 804 | |||
| 805 | 618 | $sql .= implode(', ', $sqlSelectExpressions); |
|
| 806 | |||
| 807 | 618 | return $sql; |
|
| 808 | } |
||
| 809 | |||
| 810 | /** |
||
| 811 | * {@inheritdoc} |
||
| 812 | */ |
||
| 813 | 620 | public function walkFromClause($fromClause) |
|
| 824 | |||
| 825 | /** |
||
| 826 | * Walks down a IdentificationVariableDeclaration AST node, thereby generating the appropriate SQL. |
||
| 827 | * |
||
| 828 | * @param AST\IdentificationVariableDeclaration $identificationVariableDecl |
||
| 829 | * |
||
| 830 | * @return string |
||
| 831 | */ |
||
| 832 | 621 | public function walkIdentificationVariableDeclaration($identificationVariableDecl) |
|
| 846 | |||
| 847 | /** |
||
| 848 | * Walks down a IndexBy AST node. |
||
| 849 | * |
||
| 850 | * @param AST\IndexBy $indexBy |
||
| 851 | * |
||
| 852 | * @return void |
||
| 853 | */ |
||
| 854 | 8 | public function walkIndexBy($indexBy) |
|
| 868 | |||
| 869 | /** |
||
| 870 | * Walks down a RangeVariableDeclaration AST node, thereby generating the appropriate SQL. |
||
| 871 | * |
||
| 872 | * @param AST\RangeVariableDeclaration $rangeVariableDeclaration |
||
| 873 | * |
||
| 874 | * @return string |
||
| 875 | */ |
||
| 876 | 621 | public function walkRangeVariableDeclaration($rangeVariableDeclaration) |
|
| 897 | |||
| 898 | /** |
||
| 899 | * Walks down a JoinAssociationDeclaration AST node, thereby generating the appropriate SQL. |
||
| 900 | * |
||
| 901 | * @param AST\JoinAssociationDeclaration $joinAssociationDeclaration |
||
| 902 | * @param int $joinType |
||
| 903 | * @param AST\ConditionalExpression $condExpr |
||
| 904 | * |
||
| 905 | * @return string |
||
| 906 | * |
||
| 907 | * @throws QueryException |
||
| 908 | */ |
||
| 909 | 227 | public function walkJoinAssociationDeclaration($joinAssociationDeclaration, $joinType = AST\Join::JOIN_TYPE_INNER, $condExpr = null) |
|
| 1064 | |||
| 1065 | /** |
||
| 1066 | * {@inheritdoc} |
||
| 1067 | */ |
||
| 1068 | 64 | public function walkFunction($function) |
|
| 1072 | |||
| 1073 | /** |
||
| 1074 | * {@inheritdoc} |
||
| 1075 | */ |
||
| 1076 | 153 | public function walkOrderByClause($orderByClause) |
|
| 1086 | |||
| 1087 | /** |
||
| 1088 | * {@inheritdoc} |
||
| 1089 | */ |
||
| 1090 | 171 | public function walkOrderByItem($orderByItem) |
|
| 1106 | |||
| 1107 | /** |
||
| 1108 | * {@inheritdoc} |
||
| 1109 | */ |
||
| 1110 | 14 | public function walkHavingClause($havingClause) |
|
| 1114 | |||
| 1115 | /** |
||
| 1116 | * {@inheritdoc} |
||
| 1117 | */ |
||
| 1118 | 244 | public function walkJoin($join) |
|
| 1119 | { |
||
| 1120 | 244 | $joinType = $join->joinType; |
|
| 1121 | 244 | $joinDeclaration = $join->joinAssociationDeclaration; |
|
| 1122 | |||
| 1123 | 244 | $sql = ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) |
|
| 1124 | 55 | ? ' LEFT JOIN ' |
|
| 1125 | 244 | : ' INNER JOIN '; |
|
| 1126 | |||
| 1127 | switch (true) { |
||
| 1128 | 244 | case ($joinDeclaration instanceof \Doctrine\ORM\Query\AST\RangeVariableDeclaration): |
|
| 1129 | 17 | $class = $this->em->getClassMetadata($joinDeclaration->abstractSchemaName); |
|
| 1130 | 17 | $dqlAlias = $joinDeclaration->aliasIdentificationVariable; |
|
| 1131 | 17 | $tableAlias = $this->getSQLTableAlias($class->table['name'], $dqlAlias); |
|
| 1132 | 17 | $conditions = []; |
|
| 1133 | |||
| 1134 | 17 | if ($join->conditionalExpression) { |
|
| 1135 | 15 | $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1136 | } |
||
| 1137 | |||
| 1138 | 17 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER) |
|
| 1139 | 3 | ? ' AND ' |
|
| 1140 | 17 | : ' ON '; |
|
| 1141 | |||
| 1142 | 17 | $sql .= $this->walkRangeVariableDeclaration($joinDeclaration); |
|
| 1143 | |||
| 1144 | // Apply remaining inheritance restrictions |
||
| 1145 | 17 | $discrSql = $this->_generateDiscriminatorColumnConditionSQL(array($dqlAlias)); |
|
| 1146 | |||
| 1147 | 17 | if ($discrSql) { |
|
| 1148 | 3 | $conditions[] = $discrSql; |
|
| 1149 | } |
||
| 1150 | |||
| 1151 | // Apply the filters |
||
| 1152 | 17 | $filterExpr = $this->generateFilterConditionSQL($class, $tableAlias); |
|
| 1153 | |||
| 1154 | 17 | if ($filterExpr) { |
|
| 1155 | $conditions[] = $filterExpr; |
||
| 1156 | } |
||
| 1157 | |||
| 1158 | 17 | if ($conditions) { |
|
| 1159 | 15 | $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1160 | } |
||
| 1161 | |||
| 1162 | 17 | break; |
|
| 1163 | |||
| 1164 | case ($joinDeclaration instanceof \Doctrine\ORM\Query\AST\JoinAssociationDeclaration): |
||
| 1165 | 227 | $sql .= $this->walkJoinAssociationDeclaration($joinDeclaration, $joinType, $join->conditionalExpression); |
|
| 1166 | 224 | break; |
|
| 1167 | } |
||
| 1168 | |||
| 1169 | 241 | return $sql; |
|
| 1170 | } |
||
| 1171 | |||
| 1172 | /** |
||
| 1173 | * Walks down a CaseExpression AST node and generates the corresponding SQL. |
||
| 1174 | * |
||
| 1175 | * @param AST\CoalesceExpression|AST\NullIfExpression|AST\GeneralCaseExpression|AST\SimpleCaseExpression $expression |
||
| 1176 | * |
||
| 1177 | * @return string The SQL. |
||
| 1178 | */ |
||
| 1179 | public function walkCaseExpression($expression) |
||
| 1198 | |||
| 1199 | /** |
||
| 1200 | * Walks down a CoalesceExpression AST node and generates the corresponding SQL. |
||
| 1201 | * |
||
| 1202 | * @param AST\CoalesceExpression $coalesceExpression |
||
| 1203 | * |
||
| 1204 | * @return string The SQL. |
||
| 1205 | */ |
||
| 1206 | 2 | public function walkCoalesceExpression($coalesceExpression) |
|
| 1220 | |||
| 1221 | /** |
||
| 1222 | * Walks down a NullIfExpression AST node and generates the corresponding SQL. |
||
| 1223 | * |
||
| 1224 | * @param AST\NullIfExpression $nullIfExpression |
||
| 1225 | * |
||
| 1226 | * @return string The SQL. |
||
| 1227 | */ |
||
| 1228 | 3 | public function walkNullIfExpression($nullIfExpression) |
|
| 1240 | |||
| 1241 | /** |
||
| 1242 | * Walks down a GeneralCaseExpression AST node and generates the corresponding SQL. |
||
| 1243 | * |
||
| 1244 | * @param AST\GeneralCaseExpression $generalCaseExpression |
||
| 1245 | * |
||
| 1246 | * @return string The SQL. |
||
| 1247 | */ |
||
| 1248 | 9 | public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression) |
|
| 1261 | |||
| 1262 | /** |
||
| 1263 | * Walks down a SimpleCaseExpression AST node and generates the corresponding SQL. |
||
| 1264 | * |
||
| 1265 | * @param AST\SimpleCaseExpression $simpleCaseExpression |
||
| 1266 | * |
||
| 1267 | * @return string The SQL. |
||
| 1268 | */ |
||
| 1269 | 5 | public function walkSimpleCaseExpression($simpleCaseExpression) |
|
| 1282 | |||
| 1283 | /** |
||
| 1284 | * {@inheritdoc} |
||
| 1285 | */ |
||
| 1286 | 618 | public function walkSelectExpression($selectExpression) |
|
| 1287 | { |
||
| 1288 | 618 | $sql = ''; |
|
| 1289 | 618 | $expr = $selectExpression->expression; |
|
| 1290 | 618 | $hidden = $selectExpression->hiddenAliasResultVariable; |
|
| 1291 | |||
| 1292 | switch (true) { |
||
| 1293 | 618 | case ($expr instanceof AST\PathExpression): |
|
| 1294 | 101 | if ($expr->type !== AST\PathExpression::TYPE_STATE_FIELD) { |
|
| 1295 | throw QueryException::invalidPathExpression($expr); |
||
| 1296 | } |
||
| 1297 | |||
| 1298 | 101 | $fieldName = $expr->field; |
|
| 1299 | 101 | $dqlAlias = $expr->identificationVariable; |
|
| 1300 | 101 | $qComp = $this->queryComponents[$dqlAlias]; |
|
| 1301 | 101 | $class = $qComp['metadata']; |
|
| 1302 | |||
| 1303 | 101 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $fieldName; |
|
| 1304 | 101 | $tableName = ($class->isInheritanceTypeJoined()) |
|
| 1305 | 11 | ? $this->em->getUnitOfWork()->getEntityPersister($class->name)->getOwningTable($fieldName) |
|
| 1306 | 101 | : $class->getTableName(); |
|
| 1307 | |||
| 1308 | 101 | $sqlTableAlias = $this->getSQLTableAlias($tableName, $dqlAlias); |
|
| 1309 | 101 | $fieldMapping = $class->fieldMappings[$fieldName]; |
|
| 1310 | 101 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
|
| 1311 | 101 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
|
| 1312 | 101 | $col = $sqlTableAlias . '.' . $columnName; |
|
| 1313 | |||
| 1314 | 101 | if (isset($fieldMapping['requireSQLConversion'])) { |
|
| 1315 | 2 | $type = Type::getType($fieldMapping['type']); |
|
| 1316 | 2 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
|
| 1317 | } |
||
| 1318 | |||
| 1319 | 101 | $sql .= $col . ' AS ' . $columnAlias; |
|
| 1320 | |||
| 1321 | 101 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
|
| 1322 | |||
| 1323 | 101 | if ( ! $hidden) { |
|
| 1324 | 101 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $fieldMapping['type']); |
|
| 1325 | 101 | $this->scalarFields[$dqlAlias][$fieldName] = $columnAlias; |
|
| 1326 | } |
||
| 1327 | |||
| 1328 | 101 | break; |
|
| 1329 | |||
| 1330 | case ($expr instanceof AST\AggregateExpression): |
||
| 1331 | case ($expr instanceof AST\Functions\FunctionNode): |
||
| 1332 | 10 | case ($expr instanceof AST\SimpleArithmeticExpression): |
|
| 1333 | 22 | case ($expr instanceof AST\ArithmeticTerm): |
|
| 1334 | 33 | case ($expr instanceof AST\ArithmeticFactor): |
|
| 1335 | 28 | case ($expr instanceof AST\ParenthesisExpression): |
|
| 1336 | case ($expr instanceof AST\Literal): |
||
| 1337 | 37 | case ($expr instanceof AST\NullIfExpression): |
|
| 1338 | 37 | case ($expr instanceof AST\CoalesceExpression): |
|
| 1339 | 9 | case ($expr instanceof AST\GeneralCaseExpression): |
|
| 1340 | 43 | case ($expr instanceof AST\SimpleCaseExpression): |
|
| 1341 | 106 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
|
| 1342 | 106 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
|
| 1343 | |||
| 1344 | 106 | $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1345 | |||
| 1346 | 106 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
|
| 1347 | |||
| 1348 | 106 | if ( ! $hidden) { |
|
| 1349 | // We cannot resolve field type here; assume 'string'. |
||
| 1350 | 106 | $this->rsm->addScalarResult($columnAlias, $resultAlias, 'string'); |
|
| 1351 | } |
||
| 1352 | 106 | break; |
|
| 1353 | |||
| 1354 | case ($expr instanceof AST\Subselect): |
||
| 1355 | 15 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
|
| 1356 | 15 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
|
| 1357 | |||
| 1358 | 15 | $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1359 | |||
| 1360 | 15 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
|
| 1361 | |||
| 1362 | 15 | if ( ! $hidden) { |
|
| 1363 | // We cannot resolve field type here; assume 'string'. |
||
| 1364 | 13 | $this->rsm->addScalarResult($columnAlias, $resultAlias, 'string'); |
|
| 1365 | } |
||
| 1366 | 15 | break; |
|
| 1367 | |||
| 1368 | 482 | case ($expr instanceof AST\NewObjectExpression): |
|
| 1369 | 22 | $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
| 1370 | 22 | break; |
|
| 1371 | |||
| 1372 | default: |
||
| 1373 | // IdentificationVariable or PartialObjectExpression |
||
| 1374 | 482 | if ($expr instanceof AST\PartialObjectExpression) { |
|
| 1375 | 16 | $dqlAlias = $expr->identificationVariable; |
|
| 1376 | 16 | $partialFieldSet = $expr->partialFieldSet; |
|
| 1377 | } else { |
||
| 1378 | 477 | $dqlAlias = $expr; |
|
| 1379 | 477 | $partialFieldSet = array(); |
|
| 1380 | } |
||
| 1381 | |||
| 1382 | 482 | $queryComp = $this->queryComponents[$dqlAlias]; |
|
| 1383 | 482 | $class = $queryComp['metadata']; |
|
| 1384 | 482 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; |
|
| 1385 | |||
| 1386 | 482 | if ( ! isset($this->selectedClasses[$dqlAlias])) { |
|
| 1387 | 482 | $this->selectedClasses[$dqlAlias] = array( |
|
| 1388 | 482 | 'class' => $class, |
|
| 1389 | 482 | 'dqlAlias' => $dqlAlias, |
|
| 1390 | 482 | 'resultAlias' => $resultAlias |
|
| 1391 | ); |
||
| 1392 | } |
||
| 1393 | |||
| 1394 | 482 | $sqlParts = array(); |
|
| 1395 | |||
| 1396 | // Select all fields from the queried class |
||
| 1397 | 482 | foreach ($class->fieldMappings as $fieldName => $mapping) { |
|
| 1398 | 481 | if ($partialFieldSet && ! in_array($fieldName, $partialFieldSet)) { |
|
| 1399 | 14 | continue; |
|
| 1400 | } |
||
| 1401 | |||
| 1402 | 480 | $tableName = (isset($mapping['inherited'])) |
|
| 1403 | 51 | ? $this->em->getClassMetadata($mapping['inherited'])->getTableName() |
|
| 1404 | 480 | : $class->getTableName(); |
|
| 1405 | |||
| 1406 | 480 | $sqlTableAlias = $this->getSQLTableAlias($tableName, $dqlAlias); |
|
| 1407 | 480 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
|
| 1408 | 480 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
|
| 1409 | |||
| 1410 | 480 | $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
| 1411 | |||
| 1412 | 480 | if (isset($mapping['requireSQLConversion'])) { |
|
| 1413 | 5 | $type = Type::getType($mapping['type']); |
|
| 1414 | 5 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
|
| 1415 | } |
||
| 1416 | |||
| 1417 | 480 | $sqlParts[] = $col . ' AS '. $columnAlias; |
|
| 1418 | |||
| 1419 | 480 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
|
| 1420 | |||
| 1421 | 480 | $this->rsm->addFieldResult($dqlAlias, $columnAlias, $fieldName, $class->name); |
|
| 1422 | } |
||
| 1423 | |||
| 1424 | // Add any additional fields of subclasses (excluding inherited fields) |
||
| 1425 | // 1) on Single Table Inheritance: always, since its marginal overhead |
||
| 1426 | // 2) on Class Table Inheritance only if partial objects are disallowed, |
||
| 1427 | // since it requires outer joining subtables. |
||
| 1428 | 482 | if ($class->isInheritanceTypeSingleTable() || ! $this->query->getHint(Query::HINT_FORCE_PARTIAL_LOAD)) { |
|
| 1429 | 388 | foreach ($class->subClasses as $subClassName) { |
|
| 1430 | 40 | $subClass = $this->em->getClassMetadata($subClassName); |
|
| 1431 | 40 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
|
| 1432 | |||
| 1433 | 40 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
|
| 1434 | 40 | if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
| 1435 | 40 | continue; |
|
| 1436 | } |
||
| 1437 | |||
| 1438 | 34 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
|
| 1439 | 34 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
|
| 1440 | |||
| 1441 | 34 | $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
| 1442 | |||
| 1443 | 34 | if (isset($mapping['requireSQLConversion'])) { |
|
| 1444 | $type = Type::getType($mapping['type']); |
||
| 1445 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
||
| 1446 | } |
||
| 1447 | |||
| 1448 | 34 | $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
| 1449 | |||
| 1450 | 34 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
|
| 1451 | |||
| 1452 | 40 | $this->rsm->addFieldResult($dqlAlias, $columnAlias, $fieldName, $subClassName); |
|
| 1453 | } |
||
| 1454 | } |
||
| 1455 | } |
||
| 1456 | |||
| 1457 | 482 | $sql .= implode(', ', $sqlParts); |
|
| 1458 | } |
||
| 1459 | |||
| 1460 | 618 | return $sql; |
|
| 1461 | } |
||
| 1462 | |||
| 1463 | /** |
||
| 1464 | * {@inheritdoc} |
||
| 1465 | */ |
||
| 1466 | public function walkQuantifiedExpression($qExpr) |
||
| 1470 | |||
| 1471 | /** |
||
| 1472 | * {@inheritdoc} |
||
| 1473 | */ |
||
| 1474 | 33 | public function walkSubselect($subselect) |
|
| 1495 | |||
| 1496 | /** |
||
| 1497 | * {@inheritdoc} |
||
| 1498 | */ |
||
| 1499 | 33 | public function walkSubselectFromClause($subselectFromClause) |
|
| 1510 | |||
| 1511 | /** |
||
| 1512 | * {@inheritdoc} |
||
| 1513 | */ |
||
| 1514 | 33 | public function walkSimpleSelectClause($simpleSelectClause) |
|
| 1519 | |||
| 1520 | /** |
||
| 1521 | * @param \Doctrine\ORM\Query\AST\ParenthesisExpression $parenthesisExpression |
||
| 1522 | * |
||
| 1523 | * @return string. |
||
| 1524 | */ |
||
| 1525 | 22 | public function walkParenthesisExpression(AST\ParenthesisExpression $parenthesisExpression) |
|
| 1529 | |||
| 1530 | /** |
||
| 1531 | * @param AST\NewObjectExpression $newObjectExpression |
||
| 1532 | * |
||
| 1533 | * @return string The SQL. |
||
| 1534 | */ |
||
| 1535 | 22 | public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
| 1536 | { |
||
| 1537 | 22 | $sqlSelectExpressions = array(); |
|
| 1538 | 22 | $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
| 1539 | |||
| 1540 | 22 | foreach ($newObjectExpression->args as $argIndex => $e) { |
|
| 1541 | 22 | $resultAlias = $this->scalarResultCounter++; |
|
| 1542 | 22 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
|
| 1543 | 22 | $fieldType = 'string'; |
|
| 1544 | |||
| 1545 | switch (true) { |
||
| 1546 | 22 | case ($e instanceof AST\NewObjectExpression): |
|
| 1547 | $sqlSelectExpressions[] = $e->dispatch($this); |
||
| 1548 | break; |
||
| 1549 | |||
| 1550 | case ($e instanceof AST\Subselect): |
||
| 1551 | 1 | $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1552 | 1 | break; |
|
| 1553 | |||
| 1554 | case ($e instanceof AST\PathExpression): |
||
| 1555 | 22 | $dqlAlias = $e->identificationVariable; |
|
| 1556 | 22 | $qComp = $this->queryComponents[$dqlAlias]; |
|
| 1557 | 22 | $class = $qComp['metadata']; |
|
| 1558 | 22 | $fieldType = $class->fieldMappings[$e->field]['type']; |
|
| 1559 | |||
| 1560 | 22 | $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1561 | 22 | break; |
|
| 1562 | |||
| 1563 | 5 | case ($e instanceof AST\Literal): |
|
| 1564 | 1 | switch ($e->type) { |
|
| 1565 | 1 | case AST\Literal::BOOLEAN: |
|
| 1566 | 1 | $fieldType = 'boolean'; |
|
| 1567 | 1 | break; |
|
| 1568 | |||
| 1569 | 1 | case AST\Literal::NUMERIC: |
|
| 1570 | 1 | $fieldType = is_float($e->value) ? 'float' : 'integer'; |
|
| 1571 | 1 | break; |
|
| 1572 | } |
||
| 1573 | |||
| 1574 | 1 | $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1575 | 1 | break; |
|
| 1576 | |||
| 1577 | default: |
||
| 1578 | 5 | $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1579 | 5 | break; |
|
| 1580 | } |
||
| 1581 | |||
| 1582 | 22 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
|
| 1583 | 22 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $fieldType); |
|
| 1584 | |||
| 1585 | 22 | $this->rsm->newObjectMappings[$columnAlias] = array( |
|
| 1586 | 22 | 'className' => $newObjectExpression->className, |
|
| 1587 | 22 | 'objIndex' => $objIndex, |
|
| 1588 | 22 | 'argIndex' => $argIndex |
|
| 1589 | ); |
||
| 1590 | } |
||
| 1591 | |||
| 1592 | 22 | return implode(', ', $sqlSelectExpressions); |
|
| 1593 | } |
||
| 1594 | |||
| 1595 | /** |
||
| 1596 | * {@inheritdoc} |
||
| 1597 | */ |
||
| 1598 | 33 | public function walkSimpleSelectExpression($simpleSelectExpression) |
|
| 1651 | |||
| 1652 | /** |
||
| 1653 | * {@inheritdoc} |
||
| 1654 | */ |
||
| 1655 | 75 | public function walkAggregateExpression($aggExpression) |
|
| 1660 | |||
| 1661 | /** |
||
| 1662 | * {@inheritdoc} |
||
| 1663 | */ |
||
| 1664 | 23 | public function walkGroupByClause($groupByClause) |
|
| 1674 | |||
| 1675 | /** |
||
| 1676 | * {@inheritdoc} |
||
| 1677 | */ |
||
| 1678 | 23 | public function walkGroupByItem($groupByItem) |
|
| 1721 | |||
| 1722 | /** |
||
| 1723 | * {@inheritdoc} |
||
| 1724 | */ |
||
| 1725 | 37 | public function walkDeleteClause(AST\DeleteClause $deleteClause) |
|
| 1736 | |||
| 1737 | /** |
||
| 1738 | * {@inheritdoc} |
||
| 1739 | */ |
||
| 1740 | 25 | public function walkUpdateClause($updateClause) |
|
| 1753 | |||
| 1754 | /** |
||
| 1755 | * {@inheritdoc} |
||
| 1756 | */ |
||
| 1757 | 29 | public function walkUpdateItem($updateItem) |
|
| 1783 | |||
| 1784 | /** |
||
| 1785 | * {@inheritdoc} |
||
| 1786 | */ |
||
| 1787 | 675 | public function walkWhereClause($whereClause) |
|
| 1822 | |||
| 1823 | /** |
||
| 1824 | * {@inheritdoc} |
||
| 1825 | */ |
||
| 1826 | 360 | public function walkConditionalExpression($condExpr) |
|
| 1836 | |||
| 1837 | /** |
||
| 1838 | * {@inheritdoc} |
||
| 1839 | */ |
||
| 1840 | 360 | public function walkConditionalTerm($condTerm) |
|
| 1850 | |||
| 1851 | /** |
||
| 1852 | * {@inheritdoc} |
||
| 1853 | */ |
||
| 1854 | 360 | public function walkConditionalFactor($factor) |
|
| 1862 | |||
| 1863 | /** |
||
| 1864 | * {@inheritdoc} |
||
| 1865 | */ |
||
| 1866 | 360 | public function walkConditionalPrimary($primary) |
|
| 1878 | |||
| 1879 | /** |
||
| 1880 | * {@inheritdoc} |
||
| 1881 | */ |
||
| 1882 | 5 | public function walkExistsExpression($existsExpr) |
|
| 1890 | |||
| 1891 | /** |
||
| 1892 | * {@inheritdoc} |
||
| 1893 | */ |
||
| 1894 | 6 | public function walkCollectionMemberExpression($collMemberExpr) |
|
| 2000 | |||
| 2001 | /** |
||
| 2002 | * {@inheritdoc} |
||
| 2003 | */ |
||
| 2004 | 3 | public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) |
|
| 2011 | |||
| 2012 | /** |
||
| 2013 | * {@inheritdoc} |
||
| 2014 | */ |
||
| 2015 | 10 | public function walkNullComparisonExpression($nullCompExpr) |
|
| 2032 | |||
| 2033 | /** |
||
| 2034 | * {@inheritdoc} |
||
| 2035 | */ |
||
| 2036 | 85 | public function walkInExpression($inExpr) |
|
| 2048 | |||
| 2049 | /** |
||
| 2050 | * {@inheritdoc} |
||
| 2051 | */ |
||
| 2052 | 9 | public function walkInstanceOfExpression($instanceOfExpr) |
|
| 2101 | |||
| 2102 | /** |
||
| 2103 | * {@inheritdoc} |
||
| 2104 | */ |
||
| 2105 | 77 | public function walkInParameter($inParam) |
|
| 2111 | |||
| 2112 | /** |
||
| 2113 | * {@inheritdoc} |
||
| 2114 | */ |
||
| 2115 | 149 | public function walkLiteral($literal) |
|
| 2116 | { |
||
| 2131 | |||
| 2132 | /** |
||
| 2133 | * {@inheritdoc} |
||
| 2134 | */ |
||
| 2135 | 6 | public function walkBetweenExpression($betweenExpr) |
|
| 2148 | |||
| 2149 | /** |
||
| 2150 | * {@inheritdoc} |
||
| 2151 | */ |
||
| 2152 | 9 | public function walkLikeExpression($likeExpr) |
|
| 2177 | |||
| 2178 | /** |
||
| 2179 | * {@inheritdoc} |
||
| 2180 | */ |
||
| 2181 | 5 | public function walkStateFieldPathExpression($stateFieldPathExpression) |
|
| 2185 | |||
| 2186 | /** |
||
| 2187 | * {@inheritdoc} |
||
| 2188 | */ |
||
| 2189 | 258 | public function walkComparisonExpression($compExpr) |
|
| 2207 | |||
| 2208 | /** |
||
| 2209 | * {@inheritdoc} |
||
| 2210 | */ |
||
| 2211 | 212 | public function walkInputParameter($inputParam) |
|
| 2223 | |||
| 2224 | /** |
||
| 2225 | * {@inheritdoc} |
||
| 2226 | */ |
||
| 2227 | 324 | public function walkArithmeticExpression($arithmeticExpr) |
|
| 2233 | |||
| 2234 | /** |
||
| 2235 | * {@inheritdoc} |
||
| 2236 | */ |
||
| 2237 | 386 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
|
| 2245 | |||
| 2246 | /** |
||
| 2247 | * {@inheritdoc} |
||
| 2248 | */ |
||
| 2249 | 407 | public function walkArithmeticTerm($term) |
|
| 2265 | |||
| 2266 | /** |
||
| 2267 | * {@inheritdoc} |
||
| 2268 | */ |
||
| 2269 | 407 | public function walkArithmeticFactor($factor) |
|
| 2287 | |||
| 2288 | /** |
||
| 2289 | * Walks down an ArithmeticPrimary that represents an AST node, thereby generating the appropriate SQL. |
||
| 2290 | * |
||
| 2291 | * @param mixed $primary |
||
| 2292 | * |
||
| 2293 | * @return string The SQL. |
||
| 2294 | */ |
||
| 2295 | 407 | public function walkArithmeticPrimary($primary) |
|
| 2307 | |||
| 2308 | /** |
||
| 2309 | * {@inheritdoc} |
||
| 2310 | */ |
||
| 2311 | 18 | public function walkStringPrimary($stringPrimary) |
|
| 2317 | |||
| 2318 | /** |
||
| 2319 | * {@inheritdoc} |
||
| 2320 | */ |
||
| 2321 | 30 | public function walkResultVariable($resultVariable) |
|
| 2331 | } |
||
| 2332 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.