@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | ); |
| 94 | 94 | |
| 95 | 95 | $pathExpression = new PathExpression( |
| 96 | - PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, |
|
| 96 | + PathExpression::TYPE_STATE_FIELD|PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, |
|
| 97 | 97 | $rootAlias, |
| 98 | 98 | $identifier |
| 99 | 99 | ); |
@@ -104,13 +104,13 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if (isset($AST->orderByClause)) { |
| 106 | 106 | foreach ($AST->orderByClause->orderByItems as $item) { |
| 107 | - if ( ! $item->expression instanceof PathExpression) { |
|
| 107 | + if (!$item->expression instanceof PathExpression) { |
|
| 108 | 108 | continue; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
| 112 | 112 | $this->createSelectExpressionItem($item->expression), |
| 113 | - '_dctrn_ord' . $this->_aliasCounter++ |
|
| 113 | + '_dctrn_ord'.$this->_aliasCounter++ |
|
| 114 | 114 | ); |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | && isset($queryComponents[$expression->identificationVariable])) { |
| 146 | 146 | $queryComponent = $queryComponents[$expression->identificationVariable]; |
| 147 | 147 | if (isset($queryComponent['parent']) |
| 148 | - && $queryComponent['relation']['type'] & ClassMetadataInfo::TO_MANY) { |
|
| 148 | + && $queryComponent['relation']['type']&ClassMetadataInfo::TO_MANY) { |
|
| 149 | 149 | throw new \RuntimeException("Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers."); |
| 150 | 150 | } |
| 151 | 151 | } |
@@ -44,9 +44,9 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) |
| 46 | 46 | { |
| 47 | - return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause( |
|
| 47 | + return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause( |
|
| 48 | 48 | $this->orderByClause |
| 49 | - )) . ')'; |
|
| 49 | + )).')'; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 210 | 210 | |
| 211 | 211 | if ($hasOrderBy) { |
| 212 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier); |
|
| 213 | - $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
| 212 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier); |
|
| 213 | + $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // Build the counter query |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | ); |
| 222 | 222 | |
| 223 | 223 | if ($hasOrderBy) { |
| 224 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
| 224 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | // Apply the limit and offset. |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | { |
| 369 | 369 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct |
| 370 | 370 | // statement |
| 371 | - if (! $orderByClause instanceof OrderByClause) { |
|
| 371 | + if (!$orderByClause instanceof OrderByClause) { |
|
| 372 | 372 | return $sql; |
| 373 | 373 | } |
| 374 | 374 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | = array(); |
| 405 | 405 | |
| 406 | 406 | // Generate DQL alias -> SQL table alias mapping |
| 407 | - foreach(array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
| 407 | + foreach (array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
| 408 | 408 | $dqlAliasToClassMap[$dqlAlias] = $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 409 | 409 | $dqlAliasToSqlTableAliasMap[$dqlAlias] = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 410 | 410 | } |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | $fieldSearchPattern = '/(?<![a-z0-9_])%s\.%s(?![a-z0-9_])/i'; |
| 414 | 414 | |
| 415 | 415 | // Generate search patterns for each field's path expression in the order by clause |
| 416 | - foreach($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
| 416 | + foreach ($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
| 417 | 417 | $dqlAliasForFieldAlias = $this->rsm->columnOwnerMap[$fieldAlias]; |
| 418 | 418 | $class = $dqlAliasToClassMap[$dqlAliasForFieldAlias]; |
| 419 | 419 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $replacements[] = $fieldAlias; |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | - foreach($orderByClause->orderByItems as $orderByItem) { |
|
| 452 | + foreach ($orderByClause->orderByItems as $orderByItem) { |
|
| 453 | 453 | // Walk order by item to get string representation of it |
| 454 | 454 | $orderByItemString = $this->walkOrderByItem($orderByItem); |
| 455 | 455 | |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $recursive = function ($config, $space = ' ') use (&$recursive, $output) { |
|
| 94 | + $recursive = function($config, $space = ' ') use (&$recursive, $output) { |
|
| 95 | 95 | foreach ($config as $key => $item) { |
| 96 | 96 | if (is_array($item)) { |
| 97 | 97 | $space = ' '; |