@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $normalizedAssociatedId = []; |
| 36 | 36 | |
| 37 | 37 | foreach ($targetClass->getDeclaredPropertiesIterator() as $name => $declaredProperty) { |
| 38 | - if (! array_key_exists($name, $flatIdentifier)) { |
|
| 38 | + if ( ! array_key_exists($name, $flatIdentifier)) { |
|
| 39 | 39 | continue; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | continue; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if (! ($declaredProperty instanceof ToOneAssociationMetadata)) { |
|
| 48 | + if ( ! ($declaredProperty instanceof ToOneAssociationMetadata)) { |
|
| 49 | 49 | continue; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $association = $collection->getMapping(); |
| 38 | 38 | |
| 39 | - if (! $association->isOwningSide()) { |
|
| 39 | + if ( ! $association->isOwningSide()) { |
|
| 40 | 40 | return; // ignore inverse side |
| 41 | 41 | } |
| 42 | 42 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | /** @var JoinColumnMetadata $joinColumn */ |
| 49 | 49 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 50 | 50 | |
| 51 | - if (! $joinColumn->getType()) { |
|
| 51 | + if ( ! $joinColumn->getType()) { |
|
| 52 | 52 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | $association = $collection->getMapping(); |
| 70 | 70 | |
| 71 | - if (! $association->isOwningSide()) { |
|
| 71 | + if ( ! $association->isOwningSide()) { |
|
| 72 | 72 | return; // ignore inverse side |
| 73 | 73 | } |
| 74 | 74 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $association = $collection->getMapping(); |
| 101 | 101 | |
| 102 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 102 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 103 | 103 | throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 147 | 147 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 148 | 148 | |
| 149 | - if (! $joinColumn->getType()) { |
|
| 149 | + if ( ! $joinColumn->getType()) { |
|
| 150 | 150 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 151 | 151 | } |
| 152 | 152 | |
@@ -178,9 +178,9 @@ discard block |
||
| 178 | 178 | }*/ |
| 179 | 179 | |
| 180 | 180 | $sql = 'SELECT COUNT(*)' |
| 181 | - . ' FROM ' . $joinTableName . ' t' |
|
| 181 | + . ' FROM '.$joinTableName.' t' |
|
| 182 | 182 | . $joinTargetEntitySQL |
| 183 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
| 183 | + . ' WHERE '.implode(' AND ', $conditions); |
|
| 184 | 184 | |
| 185 | 185 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
| 186 | 186 | } |
@@ -202,13 +202,13 @@ discard block |
||
| 202 | 202 | { |
| 203 | 203 | $association = $collection->getMapping(); |
| 204 | 204 | |
| 205 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 205 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 206 | 206 | throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
| 210 | 210 | |
| 211 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 211 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 212 | 212 | |
| 213 | 213 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 214 | 214 | } |
@@ -218,13 +218,13 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function contains(PersistentCollection $collection, $element) |
| 220 | 220 | { |
| 221 | - if (! $this->isValidEntityState($element)) { |
|
| 221 | + if ( ! $this->isValidEntityState($element)) { |
|
| 222 | 222 | return false; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
| 226 | 226 | |
| 227 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 227 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 228 | 228 | |
| 229 | 229 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 230 | 230 | } |
@@ -234,13 +234,13 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | public function removeElement(PersistentCollection $collection, $element) |
| 236 | 236 | { |
| 237 | - if (! $this->isValidEntityState($element)) { |
|
| 237 | + if ( ! $this->isValidEntityState($element)) { |
|
| 238 | 238 | return false; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
| 242 | 242 | |
| 243 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 243 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 244 | 244 | |
| 245 | 245 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
| 246 | 246 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $onConditions = $this->getOnConditionSQL($association); |
| 259 | 259 | $whereClauses = $params = $types = []; |
| 260 | 260 | |
| 261 | - if (! $association->isOwningSide()) { |
|
| 261 | + if ( ! $association->isOwningSide()) { |
|
| 262 | 262 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 263 | 263 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
| 264 | 264 | } else { |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 271 | 271 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 272 | 272 | |
| 273 | - if (! $joinColumn->getType()) { |
|
| 273 | + if ( ! $joinColumn->getType()) { |
|
| 274 | 274 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em)); |
| 275 | 275 | } |
| 276 | 276 | |
@@ -298,11 +298,11 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
| 300 | 300 | |
| 301 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
| 302 | - . ' FROM ' . $tableName . ' te' |
|
| 303 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
| 301 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
| 302 | + . ' FROM '.$tableName.' te' |
|
| 303 | + . ' JOIN '.$joinTableName.' t ON' |
|
| 304 | 304 | . implode(' AND ', $onConditions) |
| 305 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 305 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
| 306 | 306 | |
| 307 | 307 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
| 308 | 308 | $sql .= $this->getLimitSql($criteria); |
@@ -337,8 +337,8 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | // A join is needed if there is filtering on the target entity |
| 339 | 339 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
| 340 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
| 341 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 340 | + $joinSql = ' JOIN '.$tableName.' te' |
|
| 341 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 342 | 342 | |
| 343 | 343 | return [$joinSql, $filterSql]; |
| 344 | 344 | } |
@@ -358,21 +358,21 @@ discard block |
||
| 358 | 358 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 359 | 359 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 360 | 360 | |
| 361 | - if (! $filterExpr) { |
|
| 361 | + if ( ! $filterExpr) { |
|
| 362 | 362 | continue; |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 365 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - if (! $filterClauses) { |
|
| 368 | + if ( ! $filterClauses) { |
|
| 369 | 369 | return ''; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | $filterSql = implode(' AND ', $filterClauses); |
| 373 | 373 | |
| 374 | 374 | return isset($filterClauses[1]) |
| 375 | - ? '(' . $filterSql . ')' |
|
| 375 | + ? '('.$filterSql.')' |
|
| 376 | 376 | : $filterSql |
| 377 | 377 | ; |
| 378 | 378 | } |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 402 | 402 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 403 | 403 | |
| 404 | - $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName; |
|
| 404 | + $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName; |
|
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | return $conditions; |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 426 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 479 | 479 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 480 | 480 | |
| 481 | - if (! $joinColumn->getType()) { |
|
| 481 | + if ( ! $joinColumn->getType()) { |
|
| 482 | 482 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 483 | 483 | } |
| 484 | 484 | |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 492 | 492 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 493 | 493 | |
| 494 | - if (! $joinColumn->getType()) { |
|
| 494 | + if ( ! $joinColumn->getType()) { |
|
| 495 | 495 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 496 | 496 | } |
| 497 | 497 | |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 543 | 543 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 544 | 544 | |
| 545 | - if (! $joinColumn->getType()) { |
|
| 545 | + if ( ! $joinColumn->getType()) { |
|
| 546 | 546 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 547 | 547 | } |
| 548 | 548 | |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 556 | 556 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 557 | 557 | |
| 558 | - if (! $joinColumn->getType()) { |
|
| 558 | + if ( ! $joinColumn->getType()) { |
|
| 559 | 559 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 560 | 560 | } |
| 561 | 561 | |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 640 | 640 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
| 641 | 641 | |
| 642 | - if (! $owningAssociation->isOwningSide()) { |
|
| 642 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 643 | 643 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
| 644 | 644 | $joinTable = $owningAssociation->getJoinTable(); |
| 645 | 645 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
| 654 | - $quotedJoinTable = $joinTableName . ' t'; |
|
| 654 | + $quotedJoinTable = $joinTableName.' t'; |
|
| 655 | 655 | $whereClauses = []; |
| 656 | 656 | $params = []; |
| 657 | 657 | $types = []; |
@@ -665,11 +665,11 @@ discard block |
||
| 665 | 665 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 666 | 666 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 667 | 667 | |
| 668 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName; |
|
| 668 | + $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName; |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
| 672 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
| 672 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
| 673 | 673 | $indexByProperty = $targetClass->getProperty($indexBy); |
| 674 | 674 | |
| 675 | 675 | switch (true) { |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 693 | 693 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 694 | 694 | |
| 695 | - if (! $joinColumn->getType()) { |
|
| 695 | + if ( ! $joinColumn->getType()) { |
|
| 696 | 696 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 697 | 697 | } |
| 698 | 698 | |
@@ -701,13 +701,13 @@ discard block |
||
| 701 | 701 | $types[] = $joinColumn->getType(); |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | - if (! $joinNeeded) { |
|
| 704 | + if ( ! $joinNeeded) { |
|
| 705 | 705 | foreach ($joinColumns as $joinColumn) { |
| 706 | 706 | /** @var JoinColumnMetadata $joinColumn */ |
| 707 | 707 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 708 | 708 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 709 | 709 | |
| 710 | - if (! $joinColumn->getType()) { |
|
| 710 | + if ( ! $joinColumn->getType()) { |
|
| 711 | 711 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 712 | 712 | } |
| 713 | 713 | |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
| 722 | 722 | |
| 723 | 723 | if ($filterSql) { |
| 724 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 724 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 725 | 725 | $whereClauses[] = $filterSql; |
| 726 | 726 | } |
| 727 | 727 | } |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | $association = $collection->getMapping(); |
| 745 | 745 | $owningAssociation = $association; |
| 746 | 746 | |
| 747 | - if (! $association->isOwningSide()) { |
|
| 747 | + if ( ! $association->isOwningSide()) { |
|
| 748 | 748 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
| 749 | 749 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
| 750 | 750 | $sourceIdentifier = $this->uow->getEntityIdentifier($element); |
@@ -770,11 +770,11 @@ discard block |
||
| 770 | 770 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 771 | 771 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 772 | 772 | |
| 773 | - if (! $joinColumn->getType()) { |
|
| 773 | + if ( ! $joinColumn->getType()) { |
|
| 774 | 774 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 775 | 775 | } |
| 776 | 776 | |
| 777 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 777 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 778 | 778 | $params[] = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]]; |
| 779 | 779 | $types[] = $joinColumn->getType(); |
| 780 | 780 | } |
@@ -784,11 +784,11 @@ discard block |
||
| 784 | 784 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 785 | 785 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 786 | 786 | |
| 787 | - if (! $joinColumn->getType()) { |
|
| 787 | + if ( ! $joinColumn->getType()) { |
|
| 788 | 788 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 791 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 792 | 792 | $params[] = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]]; |
| 793 | 793 | $types[] = $joinColumn->getType(); |
| 794 | 794 | } |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
| 800 | 800 | |
| 801 | 801 | if ($filterSql) { |
| 802 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 802 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 803 | 803 | $whereClauses[] = $filterSql; |
| 804 | 804 | } |
| 805 | 805 | } |
@@ -844,10 +844,10 @@ discard block |
||
| 844 | 844 | $property = $targetClass->getProperty($name); |
| 845 | 845 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 846 | 846 | |
| 847 | - $orderBy[] = $columnName . ' ' . $direction; |
|
| 847 | + $orderBy[] = $columnName.' '.$direction; |
|
| 848 | 848 | } |
| 849 | 849 | |
| 850 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
| 850 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
| 851 | 851 | } |
| 852 | 852 | return ''; |
| 853 | 853 | } |
@@ -300,16 +300,16 @@ discard block |
||
| 300 | 300 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 301 | 301 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 302 | 302 | $identifier = array_map( |
| 303 | - function ($columnName) { |
|
| 303 | + function($columnName) { |
|
| 304 | 304 | return $this->platform->quoteIdentifier($columnName); |
| 305 | 305 | }, |
| 306 | 306 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 307 | 307 | ); |
| 308 | 308 | |
| 309 | 309 | // FIXME: Order with composite keys might not be correct |
| 310 | - $sql = 'SELECT ' . $columnName |
|
| 311 | - . ' FROM ' . $tableName |
|
| 312 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 310 | + $sql = 'SELECT '.$columnName |
|
| 311 | + . ' FROM '.$tableName |
|
| 312 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 313 | 313 | |
| 314 | 314 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 315 | 315 | $versionType = $versionProperty->getType(); |
@@ -348,13 +348,13 @@ discard block |
||
| 348 | 348 | $tableName = $this->class->getTableName(); |
| 349 | 349 | $updateData = $this->prepareUpdateData($entity); |
| 350 | 350 | |
| 351 | - if (! isset($updateData[$tableName])) { |
|
| 351 | + if ( ! isset($updateData[$tableName])) { |
|
| 352 | 352 | return; |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | $data = $updateData[$tableName]; |
| 356 | 356 | |
| 357 | - if (! $data) { |
|
| 357 | + if ( ! $data) { |
|
| 358 | 358 | return; |
| 359 | 359 | } |
| 360 | 360 | |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | $this->updateTable($entity, $quotedTableName, $data, $isVersioned); |
| 365 | 365 | |
| 366 | - if (! $isVersioned) { |
|
| 366 | + if ( ! $isVersioned) { |
|
| 367 | 367 | return; |
| 368 | 368 | } |
| 369 | 369 | |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | |
| 410 | 410 | if ($value !== null) { |
| 411 | 411 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 412 | - if (! is_array($value)) { |
|
| 412 | + if ( ! is_array($value)) { |
|
| 413 | 413 | $value = [$targetClass->identifier[0] => $value]; |
| 414 | 414 | } |
| 415 | 415 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 423 | 423 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 424 | 424 | |
| 425 | - if (! $joinColumn->getType()) { |
|
| 425 | + if ( ! $joinColumn->getType()) { |
|
| 426 | 426 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 427 | 427 | } |
| 428 | 428 | |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 489 | 489 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 490 | 490 | |
| 491 | - if (! $joinColumn->getType()) { |
|
| 491 | + if ( ! $joinColumn->getType()) { |
|
| 492 | 492 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 493 | 493 | } |
| 494 | 494 | |
@@ -515,18 +515,18 @@ discard block |
||
| 515 | 515 | case Type::SMALLINT: |
| 516 | 516 | case Type::INTEGER: |
| 517 | 517 | case Type::BIGINT: |
| 518 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 518 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 519 | 519 | break; |
| 520 | 520 | |
| 521 | 521 | case Type::DATETIME: |
| 522 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 522 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 523 | 523 | break; |
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 528 | - . ' SET ' . implode(', ', $set) |
|
| 529 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 527 | + $sql = 'UPDATE '.$quotedTableName |
|
| 528 | + . ' SET '.implode(', ', $set) |
|
| 529 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 530 | 530 | |
| 531 | 531 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 532 | 532 | |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | protected function deleteJoinTableRecords($identifier) |
| 544 | 544 | { |
| 545 | 545 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 546 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 546 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 547 | 547 | continue; |
| 548 | 548 | } |
| 549 | 549 | |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | $otherKeys = []; |
| 556 | 556 | $keys = []; |
| 557 | 557 | |
| 558 | - if (! $owningAssociation->isOwningSide()) { |
|
| 558 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 559 | 559 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 560 | 560 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 561 | 561 | } |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | foreach ($joinColumns as $joinColumn) { |
| 580 | 580 | $keys[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 581 | 581 | |
| 582 | - if (! $joinColumn->isOnDeleteCascade()) { |
|
| 582 | + if ( ! $joinColumn->isOnDeleteCascade()) { |
|
| 583 | 583 | continue; |
| 584 | 584 | } |
| 585 | 585 | |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | foreach ($otherColumns as $joinColumn) { |
| 590 | 590 | $otherKeys[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 591 | 591 | |
| 592 | - if (! $joinColumn->isOnDeleteCascade()) { |
|
| 592 | + if ( ! $joinColumn->isOnDeleteCascade()) { |
|
| 593 | 593 | continue; |
| 594 | 594 | } |
| 595 | 595 | |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | |
| 603 | 603 | $this->conn->delete($joinTableName, array_combine($keys, $identifier)); |
| 604 | 604 | |
| 605 | - if (! $selfReferential) { |
|
| 605 | + if ( ! $selfReferential) { |
|
| 606 | 606 | continue; |
| 607 | 607 | } |
| 608 | 608 | |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | // Only owning side of x-1 associations can have a FK column. |
| 677 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 677 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 678 | 678 | continue; |
| 679 | 679 | } |
| 680 | 680 | |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | /** @var JoinColumnMetadata $joinColumn */ |
| 695 | 695 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 696 | 696 | |
| 697 | - if (! $joinColumn->getType()) { |
|
| 697 | + if ( ! $joinColumn->getType()) { |
|
| 698 | 698 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 699 | 699 | } |
| 700 | 700 | |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | $propertyName = $this->class->fieldNames[$columnName]; |
| 723 | 723 | $property = $this->class->getProperty($propertyName); |
| 724 | 724 | |
| 725 | - if (! $property) { |
|
| 725 | + if ( ! $property) { |
|
| 726 | 726 | return null; |
| 727 | 727 | } |
| 728 | 728 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | /** @var JoinColumnMetadata $joinColumn */ |
| 742 | 742 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 743 | 743 | |
| 744 | - if (! $joinColumn->getType()) { |
|
| 744 | + if ( ! $joinColumn->getType()) { |
|
| 745 | 745 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 746 | 746 | } |
| 747 | 747 | |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
| 847 | 847 | $targetKeyColumn = $joinColumn->getColumnName(); |
| 848 | 848 | |
| 849 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 849 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 850 | 850 | throw MappingException::joinColumnMustPointToMappedField( |
| 851 | 851 | $sourceClass->getClassName(), |
| 852 | 852 | $sourceKeyColumn |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | $criteria = []; |
| 1074 | 1074 | $parameters = []; |
| 1075 | 1075 | |
| 1076 | - if (! $association->isOwningSide()) { |
|
| 1076 | + if ( ! $association->isOwningSide()) { |
|
| 1077 | 1077 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1078 | 1078 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1079 | 1079 | } |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | $value = $value[$targetClass->identifier[0]]; |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1105 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1106 | 1106 | $parameters[] = [ |
| 1107 | 1107 | 'value' => $value, |
| 1108 | 1108 | 'field' => $fieldName, |
@@ -1152,11 +1152,11 @@ discard block |
||
| 1152 | 1152 | |
| 1153 | 1153 | switch ($lockMode) { |
| 1154 | 1154 | case LockMode::PESSIMISTIC_READ: |
| 1155 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1155 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1156 | 1156 | break; |
| 1157 | 1157 | |
| 1158 | 1158 | case LockMode::PESSIMISTIC_WRITE: |
| 1159 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1159 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1160 | 1160 | break; |
| 1161 | 1161 | } |
| 1162 | 1162 | |
@@ -1167,14 +1167,14 @@ discard block |
||
| 1167 | 1167 | |
| 1168 | 1168 | if ($filterSql !== '') { |
| 1169 | 1169 | $conditionSql = $conditionSql |
| 1170 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1170 | + ? $conditionSql.' AND '.$filterSql |
|
| 1171 | 1171 | : $filterSql; |
| 1172 | 1172 | } |
| 1173 | 1173 | |
| 1174 | - $select = 'SELECT ' . $columnList; |
|
| 1175 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
| 1176 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1177 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1174 | + $select = 'SELECT '.$columnList; |
|
| 1175 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1176 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1177 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1178 | 1178 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1179 | 1179 | $query = $select |
| 1180 | 1180 | . $lock |
@@ -1182,7 +1182,7 @@ discard block |
||
| 1182 | 1182 | . $where |
| 1183 | 1183 | . $orderBySql; |
| 1184 | 1184 | |
| 1185 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1185 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | /** |
@@ -1201,13 +1201,13 @@ discard block |
||
| 1201 | 1201 | |
| 1202 | 1202 | if ($filterSql !== '') { |
| 1203 | 1203 | $conditionSql = $conditionSql |
| 1204 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1204 | + ? $conditionSql.' AND '.$filterSql |
|
| 1205 | 1205 | : $filterSql; |
| 1206 | 1206 | } |
| 1207 | 1207 | |
| 1208 | 1208 | $sql = 'SELECT COUNT(*) ' |
| 1209 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1210 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1209 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1210 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1211 | 1211 | |
| 1212 | 1212 | return $sql; |
| 1213 | 1213 | } |
@@ -1224,7 +1224,7 @@ discard block |
||
| 1224 | 1224 | */ |
| 1225 | 1225 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1226 | 1226 | { |
| 1227 | - if (! $orderBy) { |
|
| 1227 | + if ( ! $orderBy) { |
|
| 1228 | 1228 | return ''; |
| 1229 | 1229 | } |
| 1230 | 1230 | |
@@ -1233,7 +1233,7 @@ discard block |
||
| 1233 | 1233 | foreach ($orderBy as $fieldName => $orientation) { |
| 1234 | 1234 | $orientation = strtoupper(trim($orientation)); |
| 1235 | 1235 | |
| 1236 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1236 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1237 | 1237 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
| 1238 | 1238 | } |
| 1239 | 1239 | |
@@ -1243,11 +1243,11 @@ discard block |
||
| 1243 | 1243 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1244 | 1244 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1245 | 1245 | |
| 1246 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1246 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1247 | 1247 | |
| 1248 | 1248 | continue; |
| 1249 | 1249 | } elseif ($property instanceof AssociationMetadata) { |
| 1250 | - if (! $property->isOwningSide()) { |
|
| 1250 | + if ( ! $property->isOwningSide()) { |
|
| 1251 | 1251 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1252 | 1252 | $this->class->getClassName(), |
| 1253 | 1253 | $fieldName |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | /** @var JoinColumnMetadata $joinColumn */ |
| 1264 | 1264 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1265 | 1265 | |
| 1266 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1266 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | 1269 | continue; |
@@ -1272,7 +1272,7 @@ discard block |
||
| 1272 | 1272 | throw UnrecognizedField::byName($fieldName); |
| 1273 | 1273 | } |
| 1274 | 1274 | |
| 1275 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1275 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1276 | 1276 | } |
| 1277 | 1277 | |
| 1278 | 1278 | /** |
@@ -1314,7 +1314,7 @@ discard block |
||
| 1314 | 1314 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
| 1315 | 1315 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
| 1316 | 1316 | |
| 1317 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1317 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1318 | 1318 | break; |
| 1319 | 1319 | } |
| 1320 | 1320 | |
@@ -1329,7 +1329,7 @@ discard block |
||
| 1329 | 1329 | break; // now this is why you shouldn't use inheritance |
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1332 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1333 | 1333 | |
| 1334 | 1334 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1335 | 1335 | |
@@ -1357,14 +1357,14 @@ discard block |
||
| 1357 | 1357 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | - if (! $property->isOwningSide()) { |
|
| 1360 | + if ( ! $property->isOwningSide()) { |
|
| 1361 | 1361 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1362 | 1362 | } |
| 1363 | 1363 | |
| 1364 | 1364 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1365 | 1365 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1366 | 1366 | |
| 1367 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1367 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1368 | 1368 | |
| 1369 | 1369 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1370 | 1370 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | $joinCondition[] = $filterSql; |
| 1389 | 1389 | } |
| 1390 | 1390 | |
| 1391 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1391 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1392 | 1392 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1393 | 1393 | |
| 1394 | 1394 | break; |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | */ |
| 1411 | 1411 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1412 | 1412 | { |
| 1413 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1413 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1414 | 1414 | return ''; |
| 1415 | 1415 | } |
| 1416 | 1416 | |
@@ -1425,7 +1425,7 @@ discard block |
||
| 1425 | 1425 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1426 | 1426 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1427 | 1427 | |
| 1428 | - if (! $joinColumn->getType()) { |
|
| 1428 | + if ( ! $joinColumn->getType()) { |
|
| 1429 | 1429 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1430 | 1430 | } |
| 1431 | 1431 | |
@@ -1455,7 +1455,7 @@ discard block |
||
| 1455 | 1455 | $owningAssociation = $association; |
| 1456 | 1456 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1457 | 1457 | |
| 1458 | - if (! $association->isOwningSide()) { |
|
| 1458 | + if ( ! $association->isOwningSide()) { |
|
| 1459 | 1459 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1460 | 1460 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1461 | 1461 | } |
@@ -1477,7 +1477,7 @@ discard block |
||
| 1477 | 1477 | ); |
| 1478 | 1478 | } |
| 1479 | 1479 | |
| 1480 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1480 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1481 | 1481 | } |
| 1482 | 1482 | |
| 1483 | 1483 | /** |
@@ -1572,7 +1572,7 @@ discard block |
||
| 1572 | 1572 | $columnName = $joinColumn->getColumnName(); |
| 1573 | 1573 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1574 | 1574 | |
| 1575 | - if (! $joinColumn->getType()) { |
|
| 1575 | + if ( ! $joinColumn->getType()) { |
|
| 1576 | 1576 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1577 | 1577 | } |
| 1578 | 1578 | |
@@ -1611,7 +1611,7 @@ discard block |
||
| 1611 | 1611 | |
| 1612 | 1612 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1613 | 1613 | |
| 1614 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1614 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1615 | 1615 | } |
| 1616 | 1616 | |
| 1617 | 1617 | /** |
@@ -1625,14 +1625,14 @@ discard block |
||
| 1625 | 1625 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1626 | 1626 | { |
| 1627 | 1627 | if ($tableName) { |
| 1628 | - $tableName .= '#' . $assocName; |
|
| 1628 | + $tableName .= '#'.$assocName; |
|
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | 1631 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1632 | 1632 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1633 | 1633 | } |
| 1634 | 1634 | |
| 1635 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1635 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1636 | 1636 | |
| 1637 | 1637 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1638 | 1638 | |
@@ -1658,7 +1658,7 @@ discard block |
||
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | 1660 | $lock = $this->getLockTablesSql($lockMode); |
| 1661 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1661 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1662 | 1662 | $sql = 'SELECT 1 ' |
| 1663 | 1663 | . $lock |
| 1664 | 1664 | . $where |
@@ -1681,7 +1681,7 @@ discard block |
||
| 1681 | 1681 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1682 | 1682 | |
| 1683 | 1683 | return $this->platform->appendLockHint( |
| 1684 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1684 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1685 | 1685 | $lockMode |
| 1686 | 1686 | ); |
| 1687 | 1687 | } |
@@ -1731,19 +1731,19 @@ discard block |
||
| 1731 | 1731 | |
| 1732 | 1732 | if ($comparison !== null) { |
| 1733 | 1733 | // special case null value handling |
| 1734 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
| 1735 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1734 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
| 1735 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1736 | 1736 | |
| 1737 | 1737 | continue; |
| 1738 | 1738 | } |
| 1739 | 1739 | |
| 1740 | 1740 | if ($comparison === Comparison::NEQ && $value === null) { |
| 1741 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1741 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1742 | 1742 | |
| 1743 | 1743 | continue; |
| 1744 | 1744 | } |
| 1745 | 1745 | |
| 1746 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1746 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1747 | 1747 | |
| 1748 | 1748 | continue; |
| 1749 | 1749 | } |
@@ -1791,7 +1791,7 @@ discard block |
||
| 1791 | 1791 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1792 | 1792 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1793 | 1793 | |
| 1794 | - return [$tableAlias . '.' . $columnName]; |
|
| 1794 | + return [$tableAlias.'.'.$columnName]; |
|
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | 1797 | if ($property instanceof AssociationMetadata) { |
@@ -1800,7 +1800,7 @@ discard block |
||
| 1800 | 1800 | |
| 1801 | 1801 | // Many-To-Many requires join table check for joinColumn |
| 1802 | 1802 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1803 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1803 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1804 | 1804 | $owningAssociation = $association; |
| 1805 | 1805 | } |
| 1806 | 1806 | |
@@ -1814,17 +1814,17 @@ discard block |
||
| 1814 | 1814 | foreach ($joinColumns as $joinColumn) { |
| 1815 | 1815 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1816 | 1816 | |
| 1817 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1817 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1818 | 1818 | } |
| 1819 | 1819 | } else { |
| 1820 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1820 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1821 | 1821 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1822 | 1822 | $this->class->getClassName(), |
| 1823 | 1823 | $field |
| 1824 | 1824 | ); |
| 1825 | 1825 | } |
| 1826 | 1826 | |
| 1827 | - $class = $this->class->isInheritedProperty($field) |
|
| 1827 | + $class = $this->class->isInheritedProperty($field) |
|
| 1828 | 1828 | ? $owningAssociation->getDeclaringClass() |
| 1829 | 1829 | : $this->class |
| 1830 | 1830 | ; |
@@ -1833,7 +1833,7 @@ discard block |
||
| 1833 | 1833 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1834 | 1834 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1835 | 1835 | |
| 1836 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1836 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1837 | 1837 | } |
| 1838 | 1838 | } |
| 1839 | 1839 | |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | $value = $value[$targetClass->identifier[0]]; |
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
| 1945 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
| 1946 | 1946 | $parameters[] = [ |
| 1947 | 1947 | 'value' => $value, |
| 1948 | 1948 | 'field' => $fieldName, |
@@ -2027,7 +2027,7 @@ discard block |
||
| 2027 | 2027 | case ($property instanceof AssociationMetadata): |
| 2028 | 2028 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2029 | 2029 | |
| 2030 | - if (! $property->isOwningSide()) { |
|
| 2030 | + if ( ! $property->isOwningSide()) { |
|
| 2031 | 2031 | $property = $class->getProperty($property->getMappedBy()); |
| 2032 | 2032 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2033 | 2033 | } |
@@ -2041,7 +2041,7 @@ discard block |
||
| 2041 | 2041 | /** @var JoinColumnMetadata $joinColumn */ |
| 2042 | 2042 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2043 | 2043 | |
| 2044 | - if (! $joinColumn->getType()) { |
|
| 2044 | + if ( ! $joinColumn->getType()) { |
|
| 2045 | 2045 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2046 | 2046 | } |
| 2047 | 2047 | |
@@ -2056,7 +2056,7 @@ discard block |
||
| 2056 | 2056 | } |
| 2057 | 2057 | |
| 2058 | 2058 | if (is_array($value)) { |
| 2059 | - return array_map(function ($type) { |
|
| 2059 | + return array_map(function($type) { |
|
| 2060 | 2060 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2061 | 2061 | }, $types); |
| 2062 | 2062 | } |
@@ -2113,7 +2113,7 @@ discard block |
||
| 2113 | 2113 | */ |
| 2114 | 2114 | private function getIndividualValue($value) |
| 2115 | 2115 | { |
| 2116 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2116 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2117 | 2117 | return $value; |
| 2118 | 2118 | } |
| 2119 | 2119 | |
@@ -2127,7 +2127,7 @@ discard block |
||
| 2127 | 2127 | { |
| 2128 | 2128 | $criteria = $this->getIdentifier($entity); |
| 2129 | 2129 | |
| 2130 | - if (! $criteria) { |
|
| 2130 | + if ( ! $criteria) { |
|
| 2131 | 2131 | return false; |
| 2132 | 2132 | } |
| 2133 | 2133 | |
@@ -2135,12 +2135,12 @@ discard block |
||
| 2135 | 2135 | |
| 2136 | 2136 | $sql = 'SELECT 1 ' |
| 2137 | 2137 | . $this->getLockTablesSql(null) |
| 2138 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2138 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2139 | 2139 | |
| 2140 | 2140 | list($params, $types) = $this->expandParameters($criteria); |
| 2141 | 2141 | |
| 2142 | 2142 | if ($extraConditions !== null) { |
| 2143 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2143 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2144 | 2144 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2145 | 2145 | |
| 2146 | 2146 | $params = array_merge($params, $criteriaParams); |
@@ -2150,7 +2150,7 @@ discard block |
||
| 2150 | 2150 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
| 2151 | 2151 | |
| 2152 | 2152 | if ($filterSql) { |
| 2153 | - $sql .= ' AND ' . $filterSql; |
|
| 2153 | + $sql .= ' AND '.$filterSql; |
|
| 2154 | 2154 | } |
| 2155 | 2155 | |
| 2156 | 2156 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2163,13 +2163,13 @@ discard block |
||
| 2163 | 2163 | */ |
| 2164 | 2164 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2165 | 2165 | { |
| 2166 | - if (! $association->isOwningSide()) { |
|
| 2166 | + if ( ! $association->isOwningSide()) { |
|
| 2167 | 2167 | return 'LEFT JOIN'; |
| 2168 | 2168 | } |
| 2169 | 2169 | |
| 2170 | 2170 | // if one of the join columns is nullable, return left join |
| 2171 | 2171 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2172 | - if (! $joinColumn->isNullable()) { |
|
| 2172 | + if ( ! $joinColumn->isNullable()) { |
|
| 2173 | 2173 | continue; |
| 2174 | 2174 | } |
| 2175 | 2175 | |
@@ -2186,7 +2186,7 @@ discard block |
||
| 2186 | 2186 | */ |
| 2187 | 2187 | public function getSQLColumnAlias() |
| 2188 | 2188 | { |
| 2189 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2189 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2190 | 2190 | } |
| 2191 | 2191 | |
| 2192 | 2192 | /** |
@@ -2208,12 +2208,12 @@ discard block |
||
| 2208 | 2208 | continue; |
| 2209 | 2209 | } |
| 2210 | 2210 | |
| 2211 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2211 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2212 | 2212 | } |
| 2213 | 2213 | |
| 2214 | 2214 | $sql = implode(' AND ', $filterClauses); |
| 2215 | 2215 | |
| 2216 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2216 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2217 | 2217 | } |
| 2218 | 2218 | |
| 2219 | 2219 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | { |
| 138 | 138 | $updateData = $this->prepareUpdateData($entity); |
| 139 | 139 | |
| 140 | - if (! $updateData) { |
|
| 140 | + if ( ! $updateData) { |
|
| 141 | 141 | return; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -151,14 +151,14 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // Make sure the table with the version column is updated even if no columns on that |
| 153 | 153 | // table were affected. |
| 154 | - if (! $isVersioned) { |
|
| 154 | + if ( ! $isVersioned) { |
|
| 155 | 155 | return; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $versionedClass = $this->class->versionProperty->getDeclaringClass(); |
| 159 | 159 | $versionedTable = $versionedClass->getTableName(); |
| 160 | 160 | |
| 161 | - if (! isset($updateData[$versionedTable])) { |
|
| 161 | + if ( ! isset($updateData[$versionedTable])) { |
|
| 162 | 162 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 163 | 163 | |
| 164 | 164 | $this->updateTable($entity, $tableName, [], true); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | if ($filterSql) { |
| 240 | 240 | $conditionSql .= $conditionSql |
| 241 | - ? ' AND ' . $filterSql |
|
| 241 | + ? ' AND '.$filterSql |
|
| 242 | 242 | : $filterSql; |
| 243 | 243 | } |
| 244 | 244 | |
@@ -246,26 +246,26 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | switch ($lockMode) { |
| 248 | 248 | case LockMode::PESSIMISTIC_READ: |
| 249 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 249 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 250 | 250 | break; |
| 251 | 251 | |
| 252 | 252 | case LockMode::PESSIMISTIC_WRITE: |
| 253 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 253 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 254 | 254 | break; |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 258 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 259 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
| 258 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 259 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
| 260 | 260 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 261 | 261 | $columnList = $this->getSelectColumnsSQL(); |
| 262 | - $query = 'SELECT ' . $columnList |
|
| 262 | + $query = 'SELECT '.$columnList |
|
| 263 | 263 | . $lock |
| 264 | 264 | . $joinSql |
| 265 | 265 | . $where |
| 266 | 266 | . $orderBySql; |
| 267 | 267 | |
| 268 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 268 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -287,14 +287,14 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | if ($filterSql !== '') { |
| 289 | 289 | $conditionSql = $conditionSql |
| 290 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 290 | + ? $conditionSql.' AND '.$filterSql |
|
| 291 | 291 | : $filterSql; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $sql = 'SELECT COUNT(*) ' |
| 295 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 295 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 296 | 296 | . $joinSql |
| 297 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 297 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 298 | 298 | |
| 299 | 299 | return $sql; |
| 300 | 300 | } |
@@ -315,18 +315,18 @@ discard block |
||
| 315 | 315 | $conditions = []; |
| 316 | 316 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 317 | 317 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 318 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 318 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 319 | 319 | |
| 320 | 320 | foreach ($identifierColumns as $idColumn) { |
| 321 | 321 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 322 | 322 | |
| 323 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 323 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | $joinSql .= implode(' AND ', $conditions); |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
| 329 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | continue; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 356 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 357 | 357 | continue; |
| 358 | 358 | } |
| 359 | 359 | |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | /** @var JoinColumnMetadata $joinColumn */ |
| 364 | 364 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 365 | 365 | |
| 366 | - if (! $joinColumn->getType()) { |
|
| 366 | + if ( ! $joinColumn->getType()) { |
|
| 367 | 367 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 368 | 368 | } |
| 369 | 369 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
| 383 | 383 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 384 | 384 | |
| 385 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
| 385 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
| 386 | 386 | |
| 387 | 387 | // sub tables |
| 388 | 388 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | /** @var JoinColumnMetadata $joinColumn */ |
| 407 | 407 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 408 | 408 | |
| 409 | - if (! $joinColumn->getType()) { |
|
| 409 | + if ( ! $joinColumn->getType()) { |
|
| 410 | 410 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 411 | 411 | } |
| 412 | 412 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | $columnName = $joinColumn->getColumnName(); |
| 457 | 457 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 458 | 458 | |
| 459 | - if (! $joinColumn->getType()) { |
|
| 459 | + if ( ! $joinColumn->getType()) { |
|
| 460 | 460 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 461 | 461 | } |
| 462 | 462 | |
@@ -514,12 +514,12 @@ discard block |
||
| 514 | 514 | $conditions = []; |
| 515 | 515 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 516 | 516 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 517 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 517 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 518 | 518 | |
| 519 | 519 | foreach ($identifierColumns as $idColumn) { |
| 520 | 520 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 521 | 521 | |
| 522 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 522 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | $joinSql .= implode(' AND ', $conditions); |
@@ -531,12 +531,12 @@ discard block |
||
| 531 | 531 | $subClass = $this->em->getClassMetadata($subClassName); |
| 532 | 532 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 533 | 533 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
| 534 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 534 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 535 | 535 | |
| 536 | 536 | foreach ($identifierColumns as $idColumn) { |
| 537 | 537 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 538 | 538 | |
| 539 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 539 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | $joinSql .= implode(' AND ', $conditions); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | public function executeDeferred(EntityManagerInterface $entityManager, object $entity) : void |
| 35 | 35 | { |
| 36 | - if (! $this->executor->isDeferred()) { |
|
| 36 | + if ( ! $this->executor->isDeferred()) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | foreach ($classes as $class) { |
| 62 | 62 | $ce = $this->validateClass($class); |
| 63 | 63 | |
| 64 | - if (! $ce) { |
|
| 64 | + if ( ! $ce) { |
|
| 65 | 65 | continue; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $ce = []; |
| 82 | 82 | |
| 83 | 83 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $association) { |
| 84 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 84 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 85 | 85 | continue; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $fieldName = $association->getName(); |
| 111 | 111 | $targetEntity = $association->getTargetEntity(); |
| 112 | 112 | |
| 113 | - if (! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
| 113 | + if ( ! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
| 114 | 114 | $message = "The target entity '%s' specified on %s#%s is unknown or not an entity."; |
| 115 | 115 | |
| 116 | 116 | return [sprintf($message, $targetEntity, $class->getClassName(), $fieldName)]; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | /** @var ClassMetadata $targetMetadata */ |
| 131 | 131 | $targetMetadata = $metadataFactory->getMetadataFor($targetEntity); |
| 132 | - $containsForeignId = array_filter($targetMetadata->identifier, function ($identifier) use ($targetMetadata) { |
|
| 132 | + $containsForeignId = array_filter($targetMetadata->identifier, function($identifier) use ($targetMetadata) { |
|
| 133 | 133 | $targetProperty = $targetMetadata->getProperty($identifier); |
| 134 | 134 | |
| 135 | 135 | return $targetProperty instanceof AssociationMetadata; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | /** @var AssociationMetadata $targetAssociation */ |
| 146 | 146 | $targetAssociation = $targetMetadata->getProperty($mappedBy); |
| 147 | 147 | |
| 148 | - if (! $targetAssociation) { |
|
| 148 | + if ( ! $targetAssociation) { |
|
| 149 | 149 | $message = 'The association %s#%s refers to the owning side property %s#%s which does not exist.'; |
| 150 | 150 | |
| 151 | 151 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $mappedBy); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | /** @var AssociationMetadata $targetAssociation */ |
| 170 | 170 | $targetAssociation = $targetMetadata->getProperty($inversedBy); |
| 171 | 171 | |
| 172 | - if (! $targetAssociation) { |
|
| 172 | + if ( ! $targetAssociation) { |
|
| 173 | 173 | $message = 'The association %s#%s refers to the inverse side property %s#%s which does not exist.'; |
| 174 | 174 | |
| 175 | 175 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $inversedBy); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $joinTable = $association->getJoinTable(); |
| 214 | 214 | |
| 215 | 215 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 216 | - if (! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
| 216 | + if ( ! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
| 217 | 217 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
| 218 | 218 | |
| 219 | 219 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $class->getClassName()); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 225 | - if (! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
| 225 | + if ( ! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
| 226 | 226 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
| 227 | 227 | |
| 228 | 228 | $ce[] = sprintf($message, $inverseJoinColumn->getReferencedColumnName(), $targetMetadata->getClassName()); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | if (count($targetIdentifierColumns) !== count($joinTable->getInverseJoinColumns())) { |
| 234 | 234 | $columnNames = array_map( |
| 235 | - function (JoinColumnMetadata $joinColumn) { |
|
| 235 | + function(JoinColumnMetadata $joinColumn) { |
|
| 236 | 236 | return $joinColumn->getReferencedColumnName(); |
| 237 | 237 | }, |
| 238 | 238 | $joinTable->getInverseJoinColumns() |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | if (count($classIdentifierColumns) !== count($joinTable->getJoinColumns())) { |
| 249 | 249 | $columnNames = array_map( |
| 250 | - function (JoinColumnMetadata $joinColumn) { |
|
| 250 | + function(JoinColumnMetadata $joinColumn) { |
|
| 251 | 251 | return $joinColumn->getReferencedColumnName(); |
| 252 | 252 | }, |
| 253 | 253 | $joinTable->getJoinColumns() |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | continue; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | - if (! ($targetProperty instanceof AssociationMetadata)) { |
|
| 300 | + if ( ! ($targetProperty instanceof AssociationMetadata)) { |
|
| 301 | 301 | $message = "The association %s#%s is ordered by a property '%s' that is non-existing field on the target entity '%s'."; |
| 302 | 302 | |
| 303 | 303 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $orderField, $targetMetadata->getClassName()); |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | /** @var Query $countQuery */ |
| 222 | 222 | $countQuery = $this->cloneQuery($this->query); |
| 223 | 223 | |
| 224 | - if (! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
| 224 | + if ( ! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
| 225 | 225 | $countQuery->setHint(CountWalker::HINT_DISTINCT, true); |
| 226 | 226 | } |
| 227 | 227 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | // Rebuild string orderby expressions to use the select expression they're referencing |
| 141 | 141 | foreach ($orderByClause->orderByItems as $orderByItem) { |
| 142 | - if (! is_string($orderByItem->expression) || ! isset($selectAliasToExpressionMap[$orderByItem->expression])) { |
|
| 142 | + if ( ! is_string($orderByItem->expression) || ! isset($selectAliasToExpressionMap[$orderByItem->expression])) { |
|
| 143 | 143 | continue; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -193,13 +193,13 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $innerSql = $this->getInnerSQL($AST); |
| 195 | 195 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 196 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 196 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 197 | 197 | return $info['alias']; |
| 198 | 198 | }, $sqlIdentifier); |
| 199 | 199 | |
| 200 | 200 | if ($hasOrderBy) { |
| 201 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier); |
|
| 202 | - $sqlPiece = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
| 201 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier); |
|
| 202 | + $sqlPiece = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
| 203 | 203 | |
| 204 | 204 | $sqlAliasIdentifier[] = $sqlPiece; |
| 205 | 205 | $sqlIdentifier[] = [ |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql); |
| 213 | 213 | |
| 214 | 214 | if ($hasOrderBy) { |
| 215 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
| 215 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | // Apply the limit and offset. |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | $innerSql = $this->getInnerSQL($AST); |
| 258 | 258 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 259 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 259 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 260 | 260 | return $info['alias']; |
| 261 | 261 | }, $sqlIdentifier); |
| 262 | 262 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | $idVar = $pathExpression->identificationVariable; |
| 315 | 315 | $field = $pathExpression->field; |
| 316 | 316 | |
| 317 | - if (! isset($selects[$idVar])) { |
|
| 317 | + if ( ! isset($selects[$idVar])) { |
|
| 318 | 318 | $selects[$idVar] = []; |
| 319 | 319 | } |
| 320 | 320 | |
@@ -324,13 +324,13 @@ discard block |
||
| 324 | 324 | // Loop the select clause of the AST and exclude items from $select |
| 325 | 325 | // that are already being selected in the query. |
| 326 | 326 | foreach ($AST->selectClause->selectExpressions as $selectExpression) { |
| 327 | - if (! ($selectExpression instanceof SelectExpression)) { |
|
| 327 | + if ( ! ($selectExpression instanceof SelectExpression)) { |
|
| 328 | 328 | continue; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | $idVar = $selectExpression->expression; |
| 332 | 332 | |
| 333 | - if (! is_string($idVar)) { |
|
| 333 | + if ( ! is_string($idVar)) { |
|
| 334 | 334 | continue; |
| 335 | 335 | } |
| 336 | 336 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | ?OrderByClause $orderByClause |
| 365 | 365 | ) : string { |
| 366 | 366 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
| 367 | - if (! $orderByClause) { |
|
| 367 | + if ( ! $orderByClause) { |
|
| 368 | 368 | return $sql; |
| 369 | 369 | } |
| 370 | 370 | |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | */ |
| 562 | 562 | public function walkPathExpression($pathExpr) |
| 563 | 563 | { |
| 564 | - if (! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
| 564 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
| 565 | 565 | $this->orderByPathExpressions[] = $pathExpr; |
| 566 | 566 | } |
| 567 | 567 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($property instanceof AssociationMetadata) { |
| 55 | 55 | throw new \RuntimeException( |
| 56 | - 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. ' . |
|
| 56 | + 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. '. |
|
| 57 | 57 | 'Call Paginator#setUseOutputWalkers(true) before iterating the paginator.' |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $AST->selectClause->selectExpressions = [new SelectExpression($pathExpression, '_dctrn_id')]; |
| 72 | 72 | $AST->selectClause->isDistinct = true; |
| 73 | 73 | |
| 74 | - if (! isset($AST->orderByClause)) { |
|
| 74 | + if ( ! isset($AST->orderByClause)) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -79,19 +79,19 @@ discard block |
||
| 79 | 79 | if ($item->expression instanceof PathExpression) { |
| 80 | 80 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
| 81 | 81 | $this->createSelectExpressionItem($item->expression), |
| 82 | - '_dctrn_ord' . $this->aliasCounter++ |
|
| 82 | + '_dctrn_ord'.$this->aliasCounter++ |
|
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | 85 | continue; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if (! is_string($item->expression) || ! isset($queryComponents[$item->expression])) { |
|
| 88 | + if ( ! is_string($item->expression) || ! isset($queryComponents[$item->expression])) { |
|
| 89 | 89 | continue; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $qComp = $queryComponents[$item->expression]; |
| 93 | 93 | |
| 94 | - if (! isset($qComp['resultVariable'])) { |
|
| 94 | + if ( ! isset($qComp['resultVariable'])) { |
|
| 95 | 95 | continue; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $from = $AST->fromClause->identificationVariableDeclarations; |
| 116 | 116 | $fromRoot = reset($from); |
| 117 | 117 | |
| 118 | - if (! ($query instanceof Query) || ! $query->getMaxResults() || ! $AST->orderByClause || ! count($fromRoot->joins)) { |
|
| 118 | + if ( ! ($query instanceof Query) || ! $query->getMaxResults() || ! $AST->orderByClause || ! count($fromRoot->joins)) { |
|
| 119 | 119 | return; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | foreach ($AST->orderByClause->orderByItems as $orderByItem) { |
| 125 | 125 | $expression = $orderByItem->expression; |
| 126 | 126 | |
| 127 | - if (! ($expression instanceof PathExpression) || ! isset($queryComponents[$expression->identificationVariable])) { |
|
| 127 | + if ( ! ($expression instanceof PathExpression) || ! isset($queryComponents[$expression->identificationVariable])) { |
|
| 128 | 128 | continue; |
| 129 | 129 | } |
| 130 | 130 | |