@@ -12,11 +12,11 @@ |
||
12 | 12 | use Entities\Address; |
13 | 13 | use Entities\User; |
14 | 14 | |
15 | -$em = require_once __DIR__ . '/bootstrap.php'; |
|
15 | +$em = require_once __DIR__.'/bootstrap.php'; |
|
16 | 16 | |
17 | 17 | ## PUT YOUR TEST CODE BELOW |
18 | 18 | |
19 | 19 | $user = new User; |
20 | 20 | $address = new Address; |
21 | 21 | |
22 | -echo 'Hello World!' . PHP_EOL; |
|
22 | +echo 'Hello World!'.PHP_EOL; |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | |
6 | 6 | // Path to composer autoloader. You can use different provided by your favorite framework, |
7 | 7 | // if you want to. |
8 | -$loaderPath = __DIR__ . '/../../vendor/autoload.php'; |
|
9 | -if(!is_readable($loaderPath)){ |
|
8 | +$loaderPath = __DIR__.'/../../vendor/autoload.php'; |
|
9 | +if ( ! is_readable($loaderPath)) { |
|
10 | 10 | throw new LogicException('Run php composer.phar install at first'); |
11 | 11 | } |
12 | 12 | $loader = require $loaderPath; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $config = new \Doctrine\ORM\Configuration(); |
20 | 20 | |
21 | 21 | // Set up Metadata Drivers |
22 | -$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__ . "/Entities")); |
|
22 | +$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); |
|
23 | 23 | $config->setMetadataDriverImpl($driverImpl); |
24 | 24 | |
25 | 25 | // Set up caches, depending on $debug variable. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $config->setQueryCacheImpl($cache); |
30 | 30 | |
31 | 31 | // Proxy configuration |
32 | -$config->setProxyDir(__DIR__ . '/Proxies'); |
|
32 | +$config->setProxyDir(__DIR__.'/Proxies'); |
|
33 | 33 | $config->setProxyNamespace('Proxies'); |
34 | 34 | |
35 | 35 | // Database connection information |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $this->queryComponents = $treeWalkerChain->getQueryComponents(); |
397 | 397 | } |
398 | 398 | |
399 | - $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__ . '\SqlWalker'; |
|
399 | + $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__.'\SqlWalker'; |
|
400 | 400 | $outputWalker = new $outputWalkerClass($this->query, $this->parserResult, $this->queryComponents); |
401 | 401 | |
402 | 402 | // Assign an SQL executor to the parser result |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $tokenStr = substr($dql, $token['position'], $length); |
492 | 492 | |
493 | 493 | // Building informative message |
494 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
494 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
495 | 495 | |
496 | 496 | throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL())); |
497 | 497 | } |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | // If the namespace is not given then assumes the first FROM entity namespace |
639 | 639 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
640 | 640 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
641 | - $fqcn = $namespace . '\\' . $className; |
|
641 | + $fqcn = $namespace.'\\'.$className; |
|
642 | 642 | |
643 | 643 | if (class_exists($fqcn)) { |
644 | 644 | $expression->className = $fqcn; |
@@ -690,13 +690,13 @@ discard block |
||
690 | 690 | } |
691 | 691 | |
692 | 692 | $this->semanticalError( |
693 | - "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token'] |
|
693 | + "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token'] |
|
694 | 694 | ); |
695 | 695 | } |
696 | 696 | |
697 | 697 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
698 | 698 | $this->semanticalError( |
699 | - "The partial field selection of class " . $class->name . " must contain the identifier.", |
|
699 | + "The partial field selection of class ".$class->name." must contain the identifier.", |
|
700 | 700 | $deferredItem['token'] |
701 | 701 | ); |
702 | 702 | } |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | // Check if field or association exists |
768 | 768 | if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) { |
769 | 769 | $this->semanticalError( |
770 | - 'Class ' . $class->name . ' has no field or association named ' . $field, |
|
770 | + 'Class '.$class->name.' has no field or association named '.$field, |
|
771 | 771 | $deferredItem['token'] |
772 | 772 | ); |
773 | 773 | } |
@@ -807,8 +807,8 @@ discard block |
||
807 | 807 | // Build the error message |
808 | 808 | $semanticalError = 'Invalid PathExpression. '; |
809 | 809 | $semanticalError .= (count($expectedStringTypes) == 1) |
810 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
811 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
810 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
811 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
812 | 812 | |
813 | 813 | $this->semanticalError($semanticalError, $deferredItem['token']); |
814 | 814 | } |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | |
982 | 982 | list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']); |
983 | 983 | |
984 | - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
984 | + $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
985 | 985 | } |
986 | 986 | |
987 | 987 | return $schemaName; |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | */ |
997 | 997 | private function validateAbstractSchemaName($schemaName) |
998 | 998 | { |
999 | - if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
999 | + if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
1000 | 1000 | $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token); |
1001 | 1001 | } |
1002 | 1002 | } |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | |
1053 | 1053 | if ( ! isset($this->queryComponents[$identVariable])) { |
1054 | 1054 | $this->semanticalError( |
1055 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
1055 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1056 | 1056 | ); |
1057 | 1057 | } |
1058 | 1058 | |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | $class = $qComp['metadata']; |
1067 | 1067 | |
1068 | 1068 | if ( ! $class->hasAssociation($field)) { |
1069 | - $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field); |
|
1069 | + $this->semanticalError('Class '.$class->name.' has no association named '.$field); |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2488,7 +2488,7 @@ discard block |
||
2488 | 2488 | // Peek beyond the matching closing parenthesis ')' |
2489 | 2489 | $peek = $this->peekBeyondClosingParenthesis(); |
2490 | 2490 | |
2491 | - if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
2491 | + if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
2492 | 2492 | in_array($peek['type'], array(Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS)) || |
2493 | 2493 | $this->isMathOperator($peek)) { |
2494 | 2494 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2593,7 +2593,7 @@ discard block |
||
2593 | 2593 | return $this->NullComparisonExpression(); |
2594 | 2594 | } |
2595 | 2595 | |
2596 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2596 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2597 | 2597 | return $this->EmptyCollectionComparisonExpression(); |
2598 | 2598 | } |
2599 | 2599 |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function countDistinct($x) |
270 | 270 | { |
271 | - return 'COUNT(DISTINCT ' . implode(', ', func_get_args()) . ')'; |
|
271 | + return 'COUNT(DISTINCT '.implode(', ', func_get_args()).')'; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | } |
452 | 452 | |
453 | - return new Expr\Func($x . ' IN', (array) $y); |
|
453 | + return new Expr\Func($x.' IN', (array) $y); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | } |
472 | 472 | } |
473 | 473 | |
474 | - return new Expr\Func($x . ' NOT IN', (array) $y); |
|
474 | + return new Expr\Func($x.' NOT IN', (array) $y); |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | /** |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | */ |
484 | 484 | public function isNull($x) |
485 | 485 | { |
486 | - return $x . ' IS NULL'; |
|
486 | + return $x.' IS NULL'; |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | /** |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | */ |
496 | 496 | public function isNotNull($x) |
497 | 497 | { |
498 | - return $x . ' IS NOT NULL'; |
|
498 | + return $x.' IS NOT NULL'; |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | /** |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | */ |
614 | 614 | private function _quoteLiteral($literal) |
615 | 615 | { |
616 | - if (is_numeric($literal) && !is_string($literal)) { |
|
616 | + if (is_numeric($literal) && ! is_string($literal)) { |
|
617 | 617 | return (string) $literal; |
618 | 618 | } else if (is_bool($literal)) { |
619 | 619 | return $literal ? "true" : "false"; |
620 | 620 | } else { |
621 | - return "'" . str_replace("'", "''", $literal) . "'"; |
|
621 | + return "'".str_replace("'", "''", $literal)."'"; |
|
622 | 622 | } |
623 | 623 | } |
624 | 624 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | */ |
634 | 634 | public function between($val, $x, $y) |
635 | 635 | { |
636 | - return $val . ' BETWEEN ' . $x . ' AND ' . $y; |
|
636 | + return $val.' BETWEEN '.$x.' AND '.$y; |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | /** |
@@ -170,7 +170,7 @@ |
||
170 | 170 | |
171 | 171 | // Recognize identifiers, aliased or qualified names |
172 | 172 | case (ctype_alpha($value[0]) || $value[0] === '_' || $value[0] === '\\'): |
173 | - $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); |
|
173 | + $name = 'Doctrine\ORM\Query\Lexer::T_'.strtoupper($value); |
|
174 | 174 | |
175 | 175 | if (defined($name)) { |
176 | 176 | $type = constant($name); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public static function syntaxError($message, $previous = null) |
51 | 51 | { |
52 | - return new self('[Syntax Error] ' . $message, 0, $previous); |
|
52 | + return new self('[Syntax Error] '.$message, 0, $previous); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public static function semanticalError($message, $previous = null) |
62 | 62 | { |
63 | - return new self('[Semantical Error] ' . $message, 0, $previous); |
|
63 | + return new self('[Semantical Error] '.$message, 0, $previous); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public static function invalidParameterType($expected, $received) |
81 | 81 | { |
82 | - return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); |
|
82 | + return new self('Invalid parameter type, '.$received.' given, but '.$expected.' expected.'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public static function invalidParameterPosition($pos) |
91 | 91 | { |
92 | - return new self('Invalid parameter position: ' . $pos); |
|
92 | + return new self('Invalid parameter position: '.$pos); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public static function tooManyParameters($expected, $received) |
102 | 102 | { |
103 | - return new self('Too many parameters: the query defines ' . $expected . ' parameters and you bound ' . $received); |
|
103 | + return new self('Too many parameters: the query defines '.$expected.' parameters and you bound '.$received); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public static function tooFewParameters($expected, $received) |
113 | 113 | { |
114 | - return new self('Too few parameters: the query defines ' . $expected . ' parameters but you only bound ' . $received); |
|
114 | + return new self('Too few parameters: the query defines '.$expected.' parameters but you only bound '.$received); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | public static function invalidPathExpression($pathExpr) |
151 | 151 | { |
152 | 152 | return new self( |
153 | - "Invalid PathExpression '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "'." |
|
153 | + "Invalid PathExpression '".$pathExpr->identificationVariable.".".$pathExpr->field."'." |
|
154 | 154 | ); |
155 | 155 | } |
156 | 156 | |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | public static function partialObjectsAreDangerous() |
184 | 184 | { |
185 | 185 | return new self( |
186 | - "Loading partial objects is dangerous. Fetch full objects or consider " . |
|
187 | - "using a different fetch mode. If you really want partial objects, " . |
|
186 | + "Loading partial objects is dangerous. Fetch full objects or consider ". |
|
187 | + "using a different fetch mode. If you really want partial objects, ". |
|
188 | 188 | "set the doctrine.forcePartialLoad query hint to TRUE." |
189 | 189 | ); |
190 | 190 | } |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | public static function iterateWithFetchJoinNotAllowed($assoc) |
223 | 223 | { |
224 | 224 | return new self( |
225 | - "Iterate with fetch join in class " . $assoc['sourceEntity'] . |
|
226 | - " using association " . $assoc['fieldName'] . " not allowed." |
|
225 | + "Iterate with fetch join in class ".$assoc['sourceEntity']. |
|
226 | + " using association ".$assoc['fieldName']." not allowed." |
|
227 | 227 | ); |
228 | 228 | } |
229 | 229 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public static function instanceOfUnrelatedClass($className, $rootClass) |
249 | 249 | { |
250 | - return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . |
|
250 | + return new self("Cannot check if a child of '".$rootClass."' is instanceof '".$className."', ". |
|
251 | 251 | "inheritance hierarchy does not exists between these two classes."); |
252 | 252 | } |
253 | 253 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | public static function invalidQueryComponent($dqlAlias) |
260 | 260 | { |
261 | 261 | return new self( |
262 | - "Invalid query component given for DQL alias '" . $dqlAlias . "', ". |
|
262 | + "Invalid query component given for DQL alias '".$dqlAlias."', ". |
|
263 | 263 | "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys." |
264 | 264 | ); |
265 | 265 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | switch ($mode) { |
206 | 206 | case self::COLUMN_RENAMING_INCREMENT: |
207 | - return $columnName . $this->sqlCounter++; |
|
207 | + return $columnName.$this->sqlCounter++; |
|
208 | 208 | |
209 | 209 | case self::COLUMN_RENAMING_CUSTOM: |
210 | 210 | return isset($customRenameColumns[$columnName]) |
@@ -327,19 +327,19 @@ discard block |
||
327 | 327 | $counter = 0; |
328 | 328 | $resultMapping = $class->getSqlResultSetMapping($resultSetMappingName); |
329 | 329 | $rootShortName = $class->reflClass->getShortName(); |
330 | - $rootAlias = strtolower($rootShortName[0]) . $counter; |
|
330 | + $rootAlias = strtolower($rootShortName[0]).$counter; |
|
331 | 331 | |
332 | 332 | |
333 | 333 | if (isset($resultMapping['entities'])) { |
334 | 334 | foreach ($resultMapping['entities'] as $key => $entityMapping) { |
335 | - $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
335 | + $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
336 | 336 | |
337 | 337 | if ($class->reflClass->name == $classMetadata->reflClass->name) { |
338 | 338 | $this->addEntityResult($classMetadata->name, $rootAlias); |
339 | 339 | $this->addNamedNativeQueryEntityResultMapping($classMetadata, $entityMapping, $rootAlias); |
340 | 340 | } else { |
341 | 341 | $shortName = $classMetadata->reflClass->getShortName(); |
342 | - $joinAlias = strtolower($shortName[0]) . ++ $counter; |
|
342 | + $joinAlias = strtolower($shortName[0]).++ $counter; |
|
343 | 343 | $associations = $class->getAssociationsByTargetClass($classMetadata->name); |
344 | 344 | |
345 | 345 | $this->addNamedNativeQueryEntityResultMapping($classMetadata, $entityMapping, $joinAlias); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $this->addMetaResult($alias, $discriminatorColumn, $discriminatorColumn, false, $discriminatorType); |
388 | 388 | } |
389 | 389 | |
390 | - if (isset($entityMapping['fields']) && !empty($entityMapping['fields'])) { |
|
390 | + if (isset($entityMapping['fields']) && ! empty($entityMapping['fields'])) { |
|
391 | 391 | foreach ($entityMapping['fields'] as $field) { |
392 | 392 | $fieldName = $field['name']; |
393 | 393 | $relation = null; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $sql .= ", "; |
450 | 450 | } |
451 | 451 | |
452 | - $sql .= $tableAlias . "."; |
|
452 | + $sql .= $tableAlias."."; |
|
453 | 453 | |
454 | 454 | if (isset($this->fieldMappings[$columnName])) { |
455 | 455 | $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | $sql .= $this->discriminatorColumns[$dqlAlias]; |
461 | 461 | } |
462 | 462 | |
463 | - $sql .= " AS " . $columnName; |
|
463 | + $sql .= " AS ".$columnName; |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | return $sql; |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
78 | 78 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $primaryDqlAlias); |
79 | 79 | |
80 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
81 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
80 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
81 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
82 | 82 | |
83 | 83 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $primaryDqlAlias); |
84 | 84 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) |
93 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
93 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
94 | 94 | |
95 | 95 | // 3. Create and store DELETE statements |
96 | 96 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
97 | 97 | foreach (array_reverse($classNames) as $className) { |
98 | 98 | $tableName = $quoteStrategy->getTableName($em->getClassMetadata($className), $platform); |
99 | - $this->_sqlStatements[] = 'DELETE FROM ' . $tableName |
|
100 | - . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
99 | + $this->_sqlStatements[] = 'DELETE FROM '.$tableName |
|
100 | + . ' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // 4. Store DDL for temporary identifier table. |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | 'type' => Type::getType(PersisterHelper::getTypeOfColumn($idColumnName, $rootClass, $em)), |
109 | 109 | ); |
110 | 110 | } |
111 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
112 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
111 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
112 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
113 | 113 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
114 | 114 | } |
115 | 115 |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
89 | 89 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $updateClause->aliasIdentificationVariable); |
90 | 90 | |
91 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
92 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
91 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
92 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
93 | 93 | |
94 | 94 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $updateClause->aliasIdentificationVariable); |
95 | 95 | $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); |
98 | 98 | |
99 | 99 | // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) |
100 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
100 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
101 | 101 | |
102 | 102 | // 3. Create and store UPDATE statements |
103 | 103 | $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | foreach (array_reverse($classNames) as $className) { |
107 | 107 | $affected = false; |
108 | 108 | $class = $em->getClassMetadata($className); |
109 | - $updateSql = 'UPDATE ' . $quoteStrategy->getTableName($class, $platform) . ' SET '; |
|
109 | + $updateSql = 'UPDATE '.$quoteStrategy->getTableName($class, $platform).' SET '; |
|
110 | 110 | |
111 | 111 | foreach ($updateItems as $updateItem) { |
112 | 112 | $field = $updateItem->pathExpression->field; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($affected) { |
136 | - $this->_sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
136 | + $this->_sqlStatements[$i] = $updateSql.' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | ); |
153 | 153 | } |
154 | 154 | |
155 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
156 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
155 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
156 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
157 | 157 | |
158 | 158 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
159 | 159 | } |