@@ -5,8 +5,6 @@ |
||
5 | 5 | use Doctrine\Tests\Models\Quote\Address; |
6 | 6 | use Doctrine\Tests\Models\Quote\City; |
7 | 7 | use Doctrine\Tests\Models\Quote\FullAddress; |
8 | -use Doctrine\Tests\Models\Quote\Group; |
|
9 | -use Doctrine\Tests\Models\Quote\Phone; |
|
10 | 8 | use Doctrine\Tests\Models\Quote\User; |
11 | 9 | use Doctrine\Tests\OrmFunctionalTestCase; |
12 | 10 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $id = $this->createAddress(); |
36 | 36 | |
37 | - $addresses = $this->_em->createQuery('SELECT a FROM ' . Address::class . ' a WHERE a.id = :id') |
|
37 | + $addresses = $this->_em->createQuery('SELECT a FROM '.Address::class.' a WHERE a.id = :id') |
|
38 | 38 | ->setParameter('id', $id) |
39 | 39 | ->getResult(); |
40 | 40 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $id = $this->createFullAddress(); |
56 | 56 | |
57 | - $addresses = $this->_em->createQuery('SELECT a FROM ' . FullAddress::class . ' a WHERE a.id = :id') |
|
57 | + $addresses = $this->_em->createQuery('SELECT a FROM '.FullAddress::class.' a WHERE a.id = :id') |
|
58 | 58 | ->setParameter('id', $id) |
59 | 59 | ->getResult(); |
60 | 60 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
77 | 77 | } |
78 | 78 | |
79 | - return $sql . ' AS ' . $columnAlias; |
|
79 | + return $sql.' AS '.$columnAlias; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -94,6 +94,6 @@ discard block |
||
94 | 94 | |
95 | 95 | $this->currentPersisterContext->rsm->addMetaResult('r', $columnAlias, $joinColumnName, false, $type); |
96 | 96 | |
97 | - return $tableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
97 | + return $tableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
98 | 98 | } |
99 | 99 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $inheritedKeyColumns[] = $columnName; |
224 | 224 | } |
225 | 225 | } |
226 | - if (!empty($inheritedKeyColumns)) { |
|
226 | + if ( ! empty($inheritedKeyColumns)) { |
|
227 | 227 | // Add a FK constraint on the ID column |
228 | 228 | $table->addForeignKeyConstraint( |
229 | 229 | $this->quoteStrategy->getTableName( |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | } |
332 | 332 | |
333 | - if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas() ) { |
|
333 | + if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
334 | 334 | $schema->visit(new RemoveNamespacedAssets()); |
335 | 335 | } |
336 | 336 | |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | if ( ! $definingClass) { |
636 | 636 | throw new \Doctrine\ORM\ORMException( |
637 | 637 | "Column name `".$joinColumn['referencedColumnName']."` referenced for relation from ". |
638 | - $mapping['sourceEntity'] . " towards ". $mapping['targetEntity'] . " does not exist." |
|
638 | + $mapping['sourceEntity']." towards ".$mapping['targetEntity']." does not exist." |
|
639 | 639 | ); |
640 | 640 | } |
641 | 641 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | $columnOptions = ['notnull' => false, 'columnDefinition' => $columnDef]; |
668 | 668 | |
669 | 669 | if (isset($joinColumn['nullable'])) { |
670 | - $columnOptions['notnull'] = !$joinColumn['nullable']; |
|
670 | + $columnOptions['notnull'] = ! $joinColumn['nullable']; |
|
671 | 671 | } |
672 | 672 | |
673 | 673 | if (isset($fieldMapping['options'])) { |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | } |
715 | 715 | } |
716 | 716 | $blacklistedFks[$compositeName] = true; |
717 | - } elseif (!isset($blacklistedFks[$compositeName])) { |
|
717 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
718 | 718 | $addedFks[$compositeName] = ['foreignTableName' => $foreignTableName, 'foreignColumns' => $foreignColumns]; |
719 | 719 | $theJoinTable->addUnnamedForeignKeyConstraint( |
720 | 720 | $foreignTableName, |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | if ($table->hasPrimaryKey()) { |
822 | 822 | $columns = $table->getPrimaryKey()->getColumns(); |
823 | 823 | if (count($columns) == 1) { |
824 | - $checkSequence = $table->getName() . "_" . $columns[0] . "_seq"; |
|
824 | + $checkSequence = $table->getName()."_".$columns[0]."_seq"; |
|
825 | 825 | if ($fullSchema->hasSequence($checkSequence)) { |
826 | 826 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
827 | 827 | } |
@@ -110,6 +110,10 @@ |
||
110 | 110 | /** @Column(type = "string") */ |
111 | 111 | private $value; |
112 | 112 | |
113 | + /** |
|
114 | + * @param string $name |
|
115 | + * @param string $value |
|
116 | + */ |
|
113 | 117 | public function __construct($name, $value) |
114 | 118 | { |
115 | 119 | $this->name = $name; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $this->_em->flush(); |
43 | 43 | |
44 | 44 | $asset->getAttributes() |
45 | - ->removeElement($attribute1); |
|
45 | + ->removeElement($attribute1); |
|
46 | 46 | |
47 | 47 | $idToBeRemoved = $attribute1->id; |
48 | 48 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->_em->getClassMetadata(DDC3785_Attribute::class) |
23 | 23 | ] |
24 | 24 | ); |
25 | - } catch(\Exception $e) { |
|
25 | + } catch (\Exception $e) { |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
154 | 154 | { |
155 | - return (string)$value; |
|
155 | + return (string) $value; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $cacheAnnot = $classAnnotations[Mapping\Cache::class]; |
150 | 150 | $cacheMap = [ |
151 | 151 | 'region' => $cacheAnnot->region, |
152 | - 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage), |
|
152 | + 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage), |
|
153 | 153 | ]; |
154 | 154 | |
155 | 155 | $metadata->enableCache($cacheMap); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $inheritanceTypeAnnot = $classAnnotations[Mapping\InheritanceType::class]; |
238 | 238 | |
239 | 239 | $metadata->setInheritanceType( |
240 | - constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceTypeAnnot->value) |
|
240 | + constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceTypeAnnot->value) |
|
241 | 241 | ); |
242 | 242 | |
243 | 243 | if ($metadata->inheritanceType != Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | // Evaluate DoctrineChangeTrackingPolicy annotation |
270 | 270 | if (isset($classAnnotations[Mapping\ChangeTrackingPolicy::class])) { |
271 | 271 | $changeTrackingAnnot = $classAnnotations[Mapping\ChangeTrackingPolicy::class]; |
272 | - $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' . $changeTrackingAnnot->value)); |
|
272 | + $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_'.$changeTrackingAnnot->value)); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | // Evaluate annotations on properties/fields |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $mapping['cache'] = $metadata->getAssociationCacheDefaults( |
294 | 294 | $mapping['fieldName'], |
295 | 295 | [ |
296 | - 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage), |
|
296 | + 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage), |
|
297 | 297 | 'region' => $cacheAnnot->region, |
298 | 298 | ] |
299 | 299 | ); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | if ($generatedValueAnnot = $this->reader->getPropertyAnnotation($property, Mapping\GeneratedValue::class)) { |
326 | - $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $generatedValueAnnot->strategy)); |
|
326 | + $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_'.$generatedValueAnnot->strategy)); |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | if ($this->reader->getPropertyAnnotation($property, Mapping\Version::class)) { |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | |
473 | 473 | // Check for `fetch` |
474 | 474 | if ($associationOverride->fetch) { |
475 | - $override['fetch'] = constant(Mapping\ClassMetadata::class . '::FETCH_' . $associationOverride->fetch); |
|
475 | + $override['fetch'] = constant(Mapping\ClassMetadata::class.'::FETCH_'.$associationOverride->fetch); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | } |
517 | 517 | |
518 | 518 | // Evaluate the listener using naming convention. |
519 | - if ( ! $hasMapping ) { |
|
519 | + if ( ! $hasMapping) { |
|
520 | 520 | EntityListenerBuilder::bindEntityListener($metadata, $listenerClassName); |
521 | 521 | } |
522 | 522 | } |
@@ -545,11 +545,11 @@ discard block |
||
545 | 545 | */ |
546 | 546 | private function getFetchMode($className, $fetchMode) |
547 | 547 | { |
548 | - if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode)) { |
|
548 | + if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode)) { |
|
549 | 549 | throw MappingException::invalidFetchMode($className, $fetchMode); |
550 | 550 | } |
551 | 551 | |
552 | - return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode); |
|
552 | + return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode); |
|
553 | 553 | } |
554 | 554 | |
555 | 555 | /** |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Doctrine\Common\Cache\ArrayCache; |
6 | 6 | use Doctrine\Common\Collections\ArrayCollection; |
7 | - |
|
8 | 7 | use Doctrine\ORM\EntityManager; |
9 | 8 | use Doctrine\ORM\Internal\Hydration\IterableResult; |
10 | 9 | use Doctrine\ORM\Query\Parameter; |
@@ -85,18 +85,18 @@ discard block |
||
85 | 85 | { |
86 | 86 | $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); |
87 | 87 | $q2 = $q->expireQueryCache(true) |
88 | - ->setQueryCacheLifetime(3600) |
|
89 | - ->setQueryCacheDriver(null) |
|
90 | - ->expireResultCache(true) |
|
91 | - ->setHint('foo', 'bar') |
|
92 | - ->setHint('bar', 'baz') |
|
93 | - ->setParameter(1, 'bar') |
|
94 | - ->setParameters(new ArrayCollection([new Parameter(2, 'baz')])) |
|
95 | - ->setResultCacheDriver(null) |
|
96 | - ->setResultCacheId('foo') |
|
97 | - ->setDQL('foo') |
|
98 | - ->setFirstResult(10) |
|
99 | - ->setMaxResults(10); |
|
88 | + ->setQueryCacheLifetime(3600) |
|
89 | + ->setQueryCacheDriver(null) |
|
90 | + ->expireResultCache(true) |
|
91 | + ->setHint('foo', 'bar') |
|
92 | + ->setHint('bar', 'baz') |
|
93 | + ->setParameter(1, 'bar') |
|
94 | + ->setParameters(new ArrayCollection([new Parameter(2, 'baz')])) |
|
95 | + ->setResultCacheDriver(null) |
|
96 | + ->setResultCacheId('foo') |
|
97 | + ->setDQL('foo') |
|
98 | + ->setFirstResult(10) |
|
99 | + ->setMaxResults(10); |
|
100 | 100 | |
101 | 101 | $this->assertSame($q2, $q); |
102 | 102 | } |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); |
255 | 255 | |
256 | 256 | $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u") |
257 | - ->useResultCache(true); |
|
257 | + ->useResultCache(true); |
|
258 | 258 | |
259 | 259 | /** @var DriverConnectionMock $driverConnectionMock */ |
260 | 260 | $driverConnectionMock = $this->_em->getConnection() |
261 | - ->getWrappedConnection(); |
|
261 | + ->getWrappedConnection(); |
|
262 | 262 | |
263 | 263 | $driverConnectionMock->setStatementMock(new StatementArrayMock([['id_0' => 1]])); |
264 | 264 |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | 9 => "St Julien" |
164 | 164 | ]; |
165 | 165 | |
166 | - $query = $this->_em |
|
166 | + $query = $this->_em |
|
167 | 167 | ->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)") |
168 | 168 | ->setParameter('cities', $cities); |
169 | 169 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function testProcessParameterValueClassMetadata() |
181 | 181 | { |
182 | - $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
182 | + $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
183 | 183 | $this->assertEquals( |
184 | 184 | CmsAddress::class, |
185 | 185 | $query->processParameterValue($this->_em->getClassMetadata(CmsAddress::class)) |
@@ -341,8 +341,8 @@ discard block |
||
341 | 341 | |
342 | 342 | // FIXME: Order with composite keys might not be correct |
343 | 343 | $sql = 'SELECT ' . $columnName |
344 | - . ' FROM ' . $tableName |
|
345 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
344 | + . ' FROM ' . $tableName |
|
345 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
346 | 346 | |
347 | 347 | $types = []; |
348 | 348 | foreach ($id as $field => $value) { |
@@ -483,8 +483,8 @@ discard block |
||
483 | 483 | } |
484 | 484 | |
485 | 485 | $sql = 'UPDATE ' . $quotedTableName |
486 | - . ' SET ' . implode(', ', $set) |
|
487 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
486 | + . ' SET ' . implode(', ', $set) |
|
487 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
488 | 488 | |
489 | 489 | $result = $this->conn->executeUpdate($sql, $params, $types); |
490 | 490 | |
@@ -1539,9 +1539,9 @@ discard block |
||
1539 | 1539 | $lock = $this->getLockTablesSql($lockMode); |
1540 | 1540 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1541 | 1541 | $sql = 'SELECT 1 ' |
1542 | - . $lock |
|
1543 | - . $where |
|
1544 | - . $lockSql; |
|
1542 | + . $lock |
|
1543 | + . $where |
|
1544 | + . $lockSql; |
|
1545 | 1545 | |
1546 | 1546 | list($params, $types) = $this->expandParameters($criteria); |
1547 | 1547 | |
@@ -1992,8 +1992,8 @@ discard block |
||
1992 | 1992 | $alias = $this->getSQLTableAlias($this->class->name); |
1993 | 1993 | |
1994 | 1994 | $sql = 'SELECT 1 ' |
1995 | - . $this->getLockTablesSql(null) |
|
1996 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1995 | + . $this->getLockTablesSql(null) |
|
1996 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1997 | 1997 | |
1998 | 1998 | list($params, $types) = $this->expandParameters($criteria); |
1999 | 1999 | |
@@ -2023,9 +2023,9 @@ discard block |
||
2023 | 2023 | { |
2024 | 2024 | // if one of the join columns is nullable, return left join |
2025 | 2025 | foreach ($joinColumns as $joinColumn) { |
2026 | - if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) { |
|
2027 | - return 'LEFT JOIN'; |
|
2028 | - } |
|
2026 | + if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) { |
|
2027 | + return 'LEFT JOIN'; |
|
2028 | + } |
|
2029 | 2029 | } |
2030 | 2030 | |
2031 | 2031 | return 'INNER JOIN'; |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | $columnName = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform); |
341 | 341 | |
342 | 342 | // FIXME: Order with composite keys might not be correct |
343 | - $sql = 'SELECT ' . $columnName |
|
344 | - . ' FROM ' . $tableName |
|
345 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
343 | + $sql = 'SELECT '.$columnName |
|
344 | + . ' FROM '.$tableName |
|
345 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
346 | 346 | |
347 | 347 | $types = []; |
348 | 348 | foreach ($id as $field => $value) { |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | } |
426 | 426 | |
427 | 427 | $params[] = $value; |
428 | - $set[] = $column . ' = ' . $placeholder; |
|
428 | + $set[] = $column.' = '.$placeholder; |
|
429 | 429 | $types[] = $this->columnTypes[$columnName]; |
430 | 430 | } |
431 | 431 | |
@@ -473,18 +473,18 @@ discard block |
||
473 | 473 | case Type::SMALLINT: |
474 | 474 | case Type::INTEGER: |
475 | 475 | case Type::BIGINT: |
476 | - $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; |
|
476 | + $set[] = $versionColumn.' = '.$versionColumn.' + 1'; |
|
477 | 477 | break; |
478 | 478 | |
479 | 479 | case Type::DATETIME: |
480 | - $set[] = $versionColumn . ' = CURRENT_TIMESTAMP'; |
|
480 | + $set[] = $versionColumn.' = CURRENT_TIMESTAMP'; |
|
481 | 481 | break; |
482 | 482 | } |
483 | 483 | } |
484 | 484 | |
485 | - $sql = 'UPDATE ' . $quotedTableName |
|
486 | - . ' SET ' . implode(', ', $set) |
|
487 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
485 | + $sql = 'UPDATE '.$quotedTableName |
|
486 | + . ' SET '.implode(', ', $set) |
|
487 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
488 | 488 | |
489 | 489 | $result = $this->conn->executeUpdate($sql, $params, $types); |
490 | 490 | |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | |
528 | 528 | |
529 | 529 | if ($selfReferential) { |
530 | - $otherColumns = (! $mapping['isOwningSide']) |
|
530 | + $otherColumns = ( ! $mapping['isOwningSide']) |
|
531 | 531 | ? $association['joinTable']['joinColumns'] |
532 | 532 | : $association['joinTable']['inverseJoinColumns']; |
533 | 533 | } |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | $tableName = $this->quoteStrategy->getTableName($class, $this->platform); |
566 | 566 | $idColumns = $this->quoteStrategy->getIdentifierColumnNames($class, $this->platform); |
567 | 567 | $id = array_combine($idColumns, $identifier); |
568 | - $types = array_map(function ($identifier) use ($class, $self) { |
|
568 | + $types = array_map(function($identifier) use ($class, $self) { |
|
569 | 569 | if (isset($class->fieldMappings[$identifier])) { |
570 | 570 | return $class->fieldMappings[$identifier]['type']; |
571 | 571 | } |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | ); |
1029 | 1029 | } |
1030 | 1030 | |
1031 | - $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value; |
|
1031 | + $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value; |
|
1032 | 1032 | $parameters[] = [ |
1033 | 1033 | 'value' => $value, |
1034 | 1034 | 'field' => $field, |
@@ -1071,11 +1071,11 @@ discard block |
||
1071 | 1071 | |
1072 | 1072 | switch ($lockMode) { |
1073 | 1073 | case LockMode::PESSIMISTIC_READ: |
1074 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1074 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1075 | 1075 | break; |
1076 | 1076 | |
1077 | 1077 | case LockMode::PESSIMISTIC_WRITE: |
1078 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1078 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1079 | 1079 | break; |
1080 | 1080 | } |
1081 | 1081 | |
@@ -1086,14 +1086,14 @@ discard block |
||
1086 | 1086 | |
1087 | 1087 | if ('' !== $filterSql) { |
1088 | 1088 | $conditionSql = $conditionSql |
1089 | - ? $conditionSql . ' AND ' . $filterSql |
|
1089 | + ? $conditionSql.' AND '.$filterSql |
|
1090 | 1090 | : $filterSql; |
1091 | 1091 | } |
1092 | 1092 | |
1093 | - $select = 'SELECT ' . $columnList; |
|
1094 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1095 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1096 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1093 | + $select = 'SELECT '.$columnList; |
|
1094 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1095 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1096 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1097 | 1097 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1098 | 1098 | $query = $select |
1099 | 1099 | . $lock |
@@ -1101,7 +1101,7 @@ discard block |
||
1101 | 1101 | . $where |
1102 | 1102 | . $orderBySql; |
1103 | 1103 | |
1104 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1104 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | /** |
@@ -1120,13 +1120,13 @@ discard block |
||
1120 | 1120 | |
1121 | 1121 | if ('' !== $filterSql) { |
1122 | 1122 | $conditionSql = $conditionSql |
1123 | - ? $conditionSql . ' AND ' . $filterSql |
|
1123 | + ? $conditionSql.' AND '.$filterSql |
|
1124 | 1124 | : $filterSql; |
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | $sql = 'SELECT COUNT(*) ' |
1128 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1129 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1128 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1129 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1130 | 1130 | |
1131 | 1131 | return $sql; |
1132 | 1132 | } |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | : $baseTableAlias; |
1160 | 1160 | |
1161 | 1161 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform); |
1162 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1162 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1163 | 1163 | |
1164 | 1164 | continue; |
1165 | 1165 | } |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | |
1177 | 1177 | foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) { |
1178 | 1178 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1179 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1179 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | continue; |
@@ -1185,7 +1185,7 @@ discard block |
||
1185 | 1185 | throw ORMException::unrecognizedField($fieldName); |
1186 | 1186 | } |
1187 | 1187 | |
1188 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1188 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | /** |
@@ -1213,8 +1213,8 @@ discard block |
||
1213 | 1213 | $columnList[] = $this->getSelectColumnSQL($field, $this->class); |
1214 | 1214 | } |
1215 | 1215 | |
1216 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1217 | - $eagerAliasCounter = 0; |
|
1216 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1217 | + $eagerAliasCounter = 0; |
|
1218 | 1218 | |
1219 | 1219 | foreach ($this->class->associationMappings as $assocField => $assoc) { |
1220 | 1220 | $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class); |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | continue; // now this is why you shouldn't use inheritance |
1241 | 1241 | } |
1242 | 1242 | |
1243 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1243 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1244 | 1244 | $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField); |
1245 | 1245 | |
1246 | 1246 | foreach ($eagerEntity->fieldNames as $field) { |
@@ -1273,14 +1273,14 @@ discard block |
||
1273 | 1273 | $joinTableName = $this->quoteStrategy->getTableName($eagerEntity, $this->platform); |
1274 | 1274 | |
1275 | 1275 | if ($assoc['isOwningSide']) { |
1276 | - $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1277 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1276 | + $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1277 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1278 | 1278 | |
1279 | 1279 | foreach ($association['joinColumns'] as $joinColumn) { |
1280 | 1280 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1281 | 1281 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1282 | 1282 | $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity']) |
1283 | - . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol; |
|
1283 | + . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol; |
|
1284 | 1284 | } |
1285 | 1285 | |
1286 | 1286 | // Add filter SQL |
@@ -1296,12 +1296,12 @@ discard block |
||
1296 | 1296 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1297 | 1297 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1298 | 1298 | |
1299 | - $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = ' |
|
1300 | - . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol; |
|
1299 | + $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = ' |
|
1300 | + . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol; |
|
1301 | 1301 | } |
1302 | 1302 | } |
1303 | 1303 | |
1304 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1304 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1305 | 1305 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1306 | 1306 | } |
1307 | 1307 | |
@@ -1322,7 +1322,7 @@ discard block |
||
1322 | 1322 | */ |
1323 | 1323 | protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r') |
1324 | 1324 | { |
1325 | - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) { |
|
1325 | + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
1326 | 1326 | return ''; |
1327 | 1327 | } |
1328 | 1328 | |
@@ -1371,10 +1371,10 @@ discard block |
||
1371 | 1371 | foreach ($joinColumns as $joinColumn) { |
1372 | 1372 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1373 | 1373 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1374 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn; |
|
1374 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn; |
|
1375 | 1375 | } |
1376 | 1376 | |
1377 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1377 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1378 | 1378 | } |
1379 | 1379 | |
1380 | 1380 | /** |
@@ -1453,7 +1453,7 @@ discard block |
||
1453 | 1453 | continue; |
1454 | 1454 | } |
1455 | 1455 | |
1456 | - if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1456 | + if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1457 | 1457 | $columns[] = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform); |
1458 | 1458 | $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type']; |
1459 | 1459 | } |
@@ -1474,7 +1474,7 @@ discard block |
||
1474 | 1474 | */ |
1475 | 1475 | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') |
1476 | 1476 | { |
1477 | - $root = $alias == 'r' ? '' : $alias ; |
|
1477 | + $root = $alias == 'r' ? '' : $alias; |
|
1478 | 1478 | $tableAlias = $this->getSQLTableAlias($class->name, $root); |
1479 | 1479 | $fieldMapping = $class->fieldMappings[$field]; |
1480 | 1480 | $sql = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform)); |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
1488 | 1488 | } |
1489 | 1489 | |
1490 | - return $sql . ' AS ' . $columnAlias; |
|
1490 | + return $sql.' AS '.$columnAlias; |
|
1491 | 1491 | } |
1492 | 1492 | |
1493 | 1493 | /** |
@@ -1503,14 +1503,14 @@ discard block |
||
1503 | 1503 | protected function getSQLTableAlias($className, $assocName = '') |
1504 | 1504 | { |
1505 | 1505 | if ($assocName) { |
1506 | - $className .= '#' . $assocName; |
|
1506 | + $className .= '#'.$assocName; |
|
1507 | 1507 | } |
1508 | 1508 | |
1509 | 1509 | if (isset($this->currentPersisterContext->sqlTableAliases[$className])) { |
1510 | 1510 | return $this->currentPersisterContext->sqlTableAliases[$className]; |
1511 | 1511 | } |
1512 | 1512 | |
1513 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1513 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1514 | 1514 | |
1515 | 1515 | $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias; |
1516 | 1516 | |
@@ -1537,7 +1537,7 @@ discard block |
||
1537 | 1537 | } |
1538 | 1538 | |
1539 | 1539 | $lock = $this->getLockTablesSql($lockMode); |
1540 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1540 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1541 | 1541 | $sql = 'SELECT 1 ' |
1542 | 1542 | . $lock |
1543 | 1543 | . $where |
@@ -1559,7 +1559,7 @@ discard block |
||
1559 | 1559 | { |
1560 | 1560 | return $this->platform->appendLockHint( |
1561 | 1561 | 'FROM ' |
1562 | - . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' ' |
|
1562 | + . $this->quoteStrategy->getTableName($this->class, $this->platform).' ' |
|
1563 | 1563 | . $this->getSQLTableAlias($this->class->name), |
1564 | 1564 | $lockMode |
1565 | 1565 | ); |
@@ -1611,19 +1611,19 @@ discard block |
||
1611 | 1611 | |
1612 | 1612 | if (null !== $comparison) { |
1613 | 1613 | // special case null value handling |
1614 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1615 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1614 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1615 | + $selectedColumns[] = $column.' IS NULL'; |
|
1616 | 1616 | |
1617 | 1617 | continue; |
1618 | 1618 | } |
1619 | 1619 | |
1620 | 1620 | if ($comparison === Comparison::NEQ && null === $value) { |
1621 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1621 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1622 | 1622 | |
1623 | 1623 | continue; |
1624 | 1624 | } |
1625 | 1625 | |
1626 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1626 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1627 | 1627 | |
1628 | 1628 | continue; |
1629 | 1629 | } |
@@ -1671,7 +1671,7 @@ discard block |
||
1671 | 1671 | ? $this->class->fieldMappings[$field]['inherited'] |
1672 | 1672 | : $this->class->name; |
1673 | 1673 | |
1674 | - return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1674 | + return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1675 | 1675 | } |
1676 | 1676 | |
1677 | 1677 | if (isset($this->class->associationMappings[$field])) { |
@@ -1692,7 +1692,7 @@ discard block |
||
1692 | 1692 | |
1693 | 1693 | |
1694 | 1694 | foreach ($joinColumns as $joinColumn) { |
1695 | - $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1695 | + $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1696 | 1696 | } |
1697 | 1697 | |
1698 | 1698 | } else { |
@@ -1700,12 +1700,12 @@ discard block |
||
1700 | 1700 | throw ORMException::invalidFindByInverseAssociation($this->class->name, $field); |
1701 | 1701 | } |
1702 | 1702 | |
1703 | - $className = (isset($association['inherited'])) |
|
1703 | + $className = (isset($association['inherited'])) |
|
1704 | 1704 | ? $association['inherited'] |
1705 | 1705 | : $this->class->name; |
1706 | 1706 | |
1707 | 1707 | foreach ($association['joinColumns'] as $joinColumn) { |
1708 | - $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1708 | + $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1709 | 1709 | } |
1710 | 1710 | } |
1711 | 1711 | return $columns; |
@@ -1797,7 +1797,7 @@ discard block |
||
1797 | 1797 | $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; |
1798 | 1798 | } |
1799 | 1799 | |
1800 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1800 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1801 | 1801 | $parameters[] = [ |
1802 | 1802 | 'value' => $value, |
1803 | 1803 | 'field' => $field, |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | $field = $sourceClass->fieldNames[$sourceKeyColumn]; |
1811 | 1811 | $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); |
1812 | 1812 | |
1813 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1813 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1814 | 1814 | $parameters[] = [ |
1815 | 1815 | 'value' => $value, |
1816 | 1816 | 'field' => $field, |
@@ -1898,7 +1898,7 @@ discard block |
||
1898 | 1898 | $assoc = $class->associationMappings[$field]; |
1899 | 1899 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1900 | 1900 | |
1901 | - if (! $assoc['isOwningSide']) { |
|
1901 | + if ( ! $assoc['isOwningSide']) { |
|
1902 | 1902 | $assoc = $class->associationMappings[$assoc['mappedBy']]; |
1903 | 1903 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1904 | 1904 | } |
@@ -1907,7 +1907,7 @@ discard block |
||
1907 | 1907 | ? $assoc['relationToTargetKeyColumns'] |
1908 | 1908 | : $assoc['sourceToTargetKeyColumns']; |
1909 | 1909 | |
1910 | - foreach ($columns as $column){ |
|
1910 | + foreach ($columns as $column) { |
|
1911 | 1911 | $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em); |
1912 | 1912 | } |
1913 | 1913 | break; |
@@ -1918,7 +1918,7 @@ discard block |
||
1918 | 1918 | } |
1919 | 1919 | |
1920 | 1920 | if (is_array($value)) { |
1921 | - return array_map(function ($type) { |
|
1921 | + return array_map(function($type) { |
|
1922 | 1922 | $type = Type::getType($type); |
1923 | 1923 | |
1924 | 1924 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
@@ -1994,12 +1994,12 @@ discard block |
||
1994 | 1994 | |
1995 | 1995 | $sql = 'SELECT 1 ' |
1996 | 1996 | . $this->getLockTablesSql(null) |
1997 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1997 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
1998 | 1998 | |
1999 | 1999 | list($params, $types) = $this->expandParameters($criteria); |
2000 | 2000 | |
2001 | 2001 | if (null !== $extraConditions) { |
2002 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2002 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2003 | 2003 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2004 | 2004 | |
2005 | 2005 | $params = array_merge($params, $criteriaParams); |
@@ -2007,7 +2007,7 @@ discard block |
||
2007 | 2007 | } |
2008 | 2008 | |
2009 | 2009 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2010 | - $sql .= ' AND ' . $filterSql; |
|
2010 | + $sql .= ' AND '.$filterSql; |
|
2011 | 2011 | } |
2012 | 2012 | |
2013 | 2013 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2054,13 +2054,13 @@ discard block |
||
2054 | 2054 | |
2055 | 2055 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2056 | 2056 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2057 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2057 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2058 | 2058 | } |
2059 | 2059 | } |
2060 | 2060 | |
2061 | 2061 | $sql = implode(' AND ', $filterClauses); |
2062 | 2062 | |
2063 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2063 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2064 | 2064 | } |
2065 | 2065 | |
2066 | 2066 | /** |
@@ -89,66 +89,66 @@ discard block |
||
89 | 89 | $cmf = $this->em->getMetadataFactory(); |
90 | 90 | |
91 | 91 | foreach ($class->fieldMappings as $fieldName => $mapping) { |
92 | - if (!Type::hasType($mapping['type'])) { |
|
93 | - $ce[] = "The field '" . $class->name . "#" . $fieldName."' uses a non-existent type '" . $mapping['type'] . "'."; |
|
92 | + if ( ! Type::hasType($mapping['type'])) { |
|
93 | + $ce[] = "The field '".$class->name."#".$fieldName."' uses a non-existent type '".$mapping['type']."'."; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | 97 | foreach ($class->associationMappings as $fieldName => $assoc) { |
98 | - if (!class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
99 | - $ce[] = "The target entity '" . $assoc['targetEntity'] . "' specified on " . $class->name . '#' . $fieldName . ' is unknown or not an entity.'; |
|
98 | + if ( ! class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
99 | + $ce[] = "The target entity '".$assoc['targetEntity']."' specified on ".$class->name.'#'.$fieldName.' is unknown or not an entity.'; |
|
100 | 100 | |
101 | 101 | return $ce; |
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($assoc['mappedBy'] && $assoc['inversedBy']) { |
105 | - $ce[] = "The association " . $class . "#" . $fieldName . " cannot be defined as both inverse and owning."; |
|
105 | + $ce[] = "The association ".$class."#".$fieldName." cannot be defined as both inverse and owning."; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | $targetMetadata = $cmf->getMetadataFor($assoc['targetEntity']); |
109 | 109 | |
110 | 110 | if (isset($assoc['id']) && $targetMetadata->containsForeignIdentifier) { |
111 | - $ce[] = "Cannot map association '" . $class->name. "#". $fieldName ." as identifier, because " . |
|
112 | - "the target entity '". $targetMetadata->name . "' also maps an association as identifier."; |
|
111 | + $ce[] = "Cannot map association '".$class->name."#".$fieldName." as identifier, because ". |
|
112 | + "the target entity '".$targetMetadata->name."' also maps an association as identifier."; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if ($assoc['mappedBy']) { |
116 | 116 | if ($targetMetadata->hasField($assoc['mappedBy'])) { |
117 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
118 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which is not defined as association, but as field."; |
|
117 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
118 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which is not defined as association, but as field."; |
|
119 | 119 | } |
120 | - if (!$targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
121 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
122 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which does not exist."; |
|
120 | + if ( ! $targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
121 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
122 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which does not exist."; |
|
123 | 123 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] == null) { |
124 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the inverse side of a ". |
|
124 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the inverse side of a ". |
|
125 | 125 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
126 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
127 | - "'inversedBy=\"" . $fieldName . "\"' attribute."; |
|
126 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
127 | + "'inversedBy=\"".$fieldName."\"' attribute."; |
|
128 | 128 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] != $fieldName) { |
129 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
130 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " are ". |
|
129 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
130 | + $assoc['targetEntity']."#".$assoc['mappedBy']." are ". |
|
131 | 131 | "inconsistent with each other."; |
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($assoc['inversedBy']) { |
136 | 136 | if ($targetMetadata->hasField($assoc['inversedBy'])) { |
137 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
138 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which is not defined as association."; |
|
137 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
138 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which is not defined as association."; |
|
139 | 139 | } |
140 | 140 | |
141 | - if (!$targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
142 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
143 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which does not exist."; |
|
141 | + if ( ! $targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
142 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
143 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which does not exist."; |
|
144 | 144 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] == null) { |
145 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the owning side of a ". |
|
145 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the owning side of a ". |
|
146 | 146 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
147 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
147 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
148 | 148 | "'inversedBy' attribute."; |
149 | 149 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] != $fieldName) { |
150 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
151 | - $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " are ". |
|
150 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
151 | + $assoc['targetEntity']."#".$assoc['inversedBy']." are ". |
|
152 | 152 | "inconsistent with each other."; |
153 | 153 | } |
154 | 154 | |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | if (array_key_exists($assoc['inversedBy'], $targetMetadata->associationMappings)) { |
157 | 157 | $targetAssoc = $targetMetadata->associationMappings[$assoc['inversedBy']]; |
158 | 158 | if ($assoc['type'] == ClassMetadataInfo::ONE_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_ONE) { |
159 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is one-to-one, then the inversed " . |
|
160 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-one as well."; |
|
159 | + $ce[] = "If association ".$class->name."#".$fieldName." is one-to-one, then the inversed ". |
|
160 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-one as well."; |
|
161 | 161 | } elseif ($assoc['type'] == ClassMetadataInfo::MANY_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_MANY) { |
162 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-one, then the inversed " . |
|
163 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-many."; |
|
162 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-one, then the inversed ". |
|
163 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-many."; |
|
164 | 164 | } elseif ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY && $targetAssoc['type'] !== ClassMetadataInfo::MANY_TO_MANY) { |
165 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-many, then the inversed " . |
|
166 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be many-to-many as well."; |
|
165 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-many, then the inversed ". |
|
166 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be many-to-many as well."; |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | if ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY) { |
173 | 173 | $identifierColumns = $class->getIdentifierColumnNames(); |
174 | 174 | foreach ($assoc['joinTable']['joinColumns'] as $joinColumn) { |
175 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
176 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
175 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
176 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
177 | 177 | "has to be a primary key column on the target entity class '".$class->name."'."; |
178 | 178 | break; |
179 | 179 | } |
@@ -181,32 +181,32 @@ discard block |
||
181 | 181 | |
182 | 182 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
183 | 183 | foreach ($assoc['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { |
184 | - if (!in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
185 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
184 | + if ( ! in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
185 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
186 | 186 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
187 | 187 | break; |
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | 191 | if (count($targetMetadata->getIdentifierColumnNames()) != count($assoc['joinTable']['inverseJoinColumns'])) { |
192 | - $ce[] = "The inverse join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
193 | - "have to contain to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
194 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))) . |
|
192 | + $ce[] = "The inverse join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
193 | + "have to contain to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
194 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))). |
|
195 | 195 | "' are missing."; |
196 | 196 | } |
197 | 197 | |
198 | 198 | if (count($class->getIdentifierColumnNames()) != count($assoc['joinTable']['joinColumns'])) { |
199 | - $ce[] = "The join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
200 | - "have to contain to ALL identifier columns of the source entity '". $class->name . "', " . |
|
201 | - "however '" . implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))) . |
|
199 | + $ce[] = "The join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
200 | + "have to contain to ALL identifier columns of the source entity '".$class->name."', ". |
|
201 | + "however '".implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))). |
|
202 | 202 | "' are missing."; |
203 | 203 | } |
204 | 204 | |
205 | 205 | } elseif ($assoc['type'] & ClassMetadataInfo::TO_ONE) { |
206 | 206 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
207 | 207 | foreach ($assoc['joinColumns'] as $joinColumn) { |
208 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
209 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
208 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
209 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
210 | 210 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
211 | 211 | } |
212 | 212 | } |
@@ -218,9 +218,9 @@ discard block |
||
218 | 218 | $ids[] = $joinColumn['name']; |
219 | 219 | } |
220 | 220 | |
221 | - $ce[] = "The join columns of the association '" . $assoc['fieldName'] . "' " . |
|
222 | - "have to match to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
223 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)) . |
|
221 | + $ce[] = "The join columns of the association '".$assoc['fieldName']."' ". |
|
222 | + "have to match to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
223 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)). |
|
224 | 224 | "' are missing."; |
225 | 225 | } |
226 | 226 | } |
@@ -228,19 +228,19 @@ discard block |
||
228 | 228 | |
229 | 229 | if (isset($assoc['orderBy']) && $assoc['orderBy'] !== null) { |
230 | 230 | foreach ($assoc['orderBy'] as $orderField => $orientation) { |
231 | - if (!$targetMetadata->hasField($orderField) && !$targetMetadata->hasAssociation($orderField)) { |
|
232 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a foreign field " . |
|
233 | - $orderField . " that is not a field on the target entity " . $targetMetadata->name . "."; |
|
231 | + if ( ! $targetMetadata->hasField($orderField) && ! $targetMetadata->hasAssociation($orderField)) { |
|
232 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a foreign field ". |
|
233 | + $orderField." that is not a field on the target entity ".$targetMetadata->name."."; |
|
234 | 234 | continue; |
235 | 235 | } |
236 | 236 | if ($targetMetadata->isCollectionValuedAssociation($orderField)) { |
237 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
238 | - $orderField . " on " . $targetMetadata->name . " that is a collection-valued association."; |
|
237 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
238 | + $orderField." on ".$targetMetadata->name." that is a collection-valued association."; |
|
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | if ($targetMetadata->isAssociationInverseSide($orderField)) { |
242 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
243 | - $orderField . " on " . $targetMetadata->name . " that is the inverse side of an association."; |
|
242 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
243 | + $orderField." on ".$targetMetadata->name." that is the inverse side of an association."; |
|
244 | 244 | continue; |
245 | 245 | } |
246 | 246 | } |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | } |
249 | 249 | |
250 | 250 | foreach ($class->subClasses as $subClass) { |
251 | - if (!in_array($class->name, class_parents($subClass))) { |
|
252 | - $ce[] = "According to the discriminator map class '" . $subClass . "' has to be a child ". |
|
253 | - "of '" . $class->name . "' but these entities are not related through inheritance."; |
|
251 | + if ( ! in_array($class->name, class_parents($subClass))) { |
|
252 | + $ce[] = "According to the discriminator map class '".$subClass."' has to be a child ". |
|
253 | + "of '".$class->name."' but these entities are not related through inheritance."; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $class->reflFields[$fieldName]->setValue($entity, $value); |
200 | 200 | $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value); |
201 | 201 | |
202 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
202 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
203 | 203 | } else if ( |
204 | 204 | isset($this->_hints[Query::HINT_REFRESH]) || |
205 | 205 | isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) && |
@@ -210,10 +210,10 @@ discard block |
||
210 | 210 | $value->setInitialized(true); |
211 | 211 | $value->unwrap()->clear(); |
212 | 212 | |
213 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
213 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
214 | 214 | } else { |
215 | 215 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
216 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
216 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | return $value; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $idHash = ''; |
288 | 288 | |
289 | 289 | foreach ($class->identifier as $fieldName) { |
290 | - $idHash .= ' ' . (isset($class->associationMappings[$fieldName]) |
|
290 | + $idHash .= ' '.(isset($class->associationMappings[$fieldName]) |
|
291 | 291 | ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] |
292 | 292 | : $data[$fieldName]); |
293 | 293 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias]; |
344 | 344 | // we need the $path to save into the identifier map which entities were already |
345 | 345 | // seen for this parent-child relationship |
346 | - $path = $parentAlias . '.' . $dqlAlias; |
|
346 | + $path = $parentAlias.'.'.$dqlAlias; |
|
347 | 347 | |
348 | 348 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
349 | 349 | if ( ! isset($nonemptyComponents[$parentAlias])) { |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $reflFieldValue = $reflField->getValue($parentObject); |
384 | 384 | |
385 | 385 | if (isset($nonemptyComponents[$dqlAlias])) { |
386 | - $collKey = $oid . $relationField; |
|
386 | + $collKey = $oid.$relationField; |
|
387 | 387 | if (isset($this->initializedCollections[$collKey])) { |
388 | 388 | $reflFieldValue = $this->initializedCollections[$collKey]; |
389 | 389 | } else if ( ! isset($this->existingCollections[$collKey])) { |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | // PATH B: Single-valued association |
432 | 432 | $reflFieldValue = $reflField->getValue($parentObject); |
433 | 433 | |
434 | - if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) { |
|
434 | + if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized__)) { |
|
435 | 435 | // we only need to take action if this value is null, |
436 | 436 | // we refresh the entity or its an uninitialized proxy. |
437 | 437 | if (isset($nonemptyComponents[$dqlAlias])) { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
477 | 477 | |
478 | 478 | // if this row has a NULL value for the root result id then make it a null result. |
479 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
479 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
480 | 480 | if ($this->_rsm->isMixed) { |
481 | 481 | $result[] = [$entityKey => null]; |
482 | 482 | } else { |
@@ -532,13 +532,13 @@ discard block |
||
532 | 532 | } |
533 | 533 | } |
534 | 534 | |
535 | - if ( ! isset($resultKey) ) { |
|
535 | + if ( ! isset($resultKey)) { |
|
536 | 536 | $this->resultCounter++; |
537 | 537 | } |
538 | 538 | |
539 | 539 | // Append scalar values to mixed result sets |
540 | 540 | if (isset($rowData['scalars'])) { |
541 | - if ( ! isset($resultKey) ) { |
|
541 | + if ( ! isset($resultKey)) { |
|
542 | 542 | $resultKey = (isset($this->_rsm->indexByMap['scalars'])) |
543 | 543 | ? $row[$this->_rsm->indexByMap['scalars']] |
544 | 544 | : $this->resultCounter - 1; |
@@ -551,19 +551,19 @@ discard block |
||
551 | 551 | |
552 | 552 | // Append new object to mixed result sets |
553 | 553 | if (isset($rowData['newObjects'])) { |
554 | - if ( ! isset($resultKey) ) { |
|
554 | + if ( ! isset($resultKey)) { |
|
555 | 555 | $resultKey = $this->resultCounter - 1; |
556 | 556 | } |
557 | 557 | |
558 | 558 | |
559 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
559 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
560 | 560 | |
561 | 561 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
562 | 562 | $class = $newObject['class']; |
563 | 563 | $args = $newObject['args']; |
564 | 564 | $obj = $class->newInstanceArgs($args); |
565 | 565 | |
566 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
566 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
567 | 567 | $result[$resultKey] = $obj; |
568 | 568 | |
569 | 569 | continue; |