@@ -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 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | // For now, this is a hack required for single table inheritence, since this method is called |
| 406 | 406 | // twice by single table inheritence relations |
| 407 | - if (!$table->hasIndex('primary')) { |
|
| 407 | + if ( ! $table->hasIndex('primary')) { |
|
| 408 | 408 | //$table->setPrimaryKey($pkColumns); |
| 409 | 409 | } |
| 410 | 410 | } |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | if ( ! $definingClass) { |
| 642 | 642 | throw new \Doctrine\ORM\ORMException( |
| 643 | 643 | "Column name `".$joinColumn['referencedColumnName']."` referenced for relation from ". |
| 644 | - $mapping['sourceEntity'] . " towards ". $mapping['targetEntity'] . " does not exist." |
|
| 644 | + $mapping['sourceEntity']." towards ".$mapping['targetEntity']." does not exist." |
|
| 645 | 645 | ); |
| 646 | 646 | } |
| 647 | 647 | |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | $columnOptions = array('notnull' => false, 'columnDefinition' => $columnDef); |
| 674 | 674 | |
| 675 | 675 | if (isset($joinColumn['nullable'])) { |
| 676 | - $columnOptions['notnull'] = !$joinColumn['nullable']; |
|
| 676 | + $columnOptions['notnull'] = ! $joinColumn['nullable']; |
|
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | if (isset($fieldMapping['options'])) { |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | } |
| 721 | 721 | } |
| 722 | 722 | $blacklistedFks[$compositeName] = true; |
| 723 | - } elseif (!isset($blacklistedFks[$compositeName])) { |
|
| 723 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
| 724 | 724 | $addedFks[$compositeName] = array('foreignTableName' => $foreignTableName, 'foreignColumns' => $foreignColumns); |
| 725 | 725 | $theJoinTable->addUnnamedForeignKeyConstraint( |
| 726 | 726 | $foreignTableName, |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | if ($table->hasPrimaryKey()) { |
| 828 | 828 | $columns = $table->getPrimaryKey()->getColumns(); |
| 829 | 829 | if (count($columns) == 1) { |
| 830 | - $checkSequence = $table->getName() . "_" . $columns[0] . "_seq"; |
|
| 830 | + $checkSequence = $table->getName()."_".$columns[0]."_seq"; |
|
| 831 | 831 | if ($fullSchema->hasSequence($checkSequence)) { |
| 832 | 832 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
| 833 | 833 | } |
@@ -242,17 +242,17 @@ |
||
| 242 | 242 | public function getUnitOfWork(); |
| 243 | 243 | |
| 244 | 244 | /** |
| 245 | - * Gets a hydrator for the given hydration mode. |
|
| 246 | - * |
|
| 247 | - * This method caches the hydrator instances which is used for all queries that don't |
|
| 248 | - * selectively iterate over the result. |
|
| 249 | - * |
|
| 250 | - * @deprecated |
|
| 251 | - * |
|
| 252 | - * @param int $hydrationMode |
|
| 253 | - * |
|
| 254 | - * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator |
|
| 255 | - */ |
|
| 245 | + * Gets a hydrator for the given hydration mode. |
|
| 246 | + * |
|
| 247 | + * This method caches the hydrator instances which is used for all queries that don't |
|
| 248 | + * selectively iterate over the result. |
|
| 249 | + * |
|
| 250 | + * @deprecated |
|
| 251 | + * |
|
| 252 | + * @param int $hydrationMode |
|
| 253 | + * |
|
| 254 | + * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator |
|
| 255 | + */ |
|
| 256 | 256 | public function getHydrator($hydrationMode); |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | // It's a joined result |
| 109 | 109 | |
| 110 | 110 | $parent = $this->_rsm->parentAliasMap[$dqlAlias]; |
| 111 | - $path = $parent . '.' . $dqlAlias; |
|
| 111 | + $path = $parent.'.'.$dqlAlias; |
|
| 112 | 112 | |
| 113 | 113 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 114 | - if ( ! isset($nonemptyComponents[$parent]) ) { |
|
| 114 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 115 | 115 | continue; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -120,9 +120,9 @@ discard block |
||
| 120 | 120 | if ($this->_rsm->isMixed && isset($this->_rootAliases[$parent])) { |
| 121 | 121 | $first = reset($this->_resultPointers); |
| 122 | 122 | // TODO: Exception if $key === null ? |
| 123 | - $baseElement =& $this->_resultPointers[$parent][key($first)]; |
|
| 123 | + $baseElement = & $this->_resultPointers[$parent][key($first)]; |
|
| 124 | 124 | } else if (isset($this->_resultPointers[$parent])) { |
| 125 | - $baseElement =& $this->_resultPointers[$parent]; |
|
| 125 | + $baseElement = & $this->_resultPointers[$parent]; |
|
| 126 | 126 | } else { |
| 127 | 127 | unset($this->_resultPointers[$dqlAlias]); // Ticket #1228 |
| 128 | 128 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - $coll =& $baseElement[$relationAlias]; |
|
| 176 | + $coll = & $baseElement[$relationAlias]; |
|
| 177 | 177 | |
| 178 | 178 | if (is_array($coll)) { |
| 179 | 179 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
| 186 | 186 | |
| 187 | 187 | // if this row has a NULL value for the root result id then make it a null result. |
| 188 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 188 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 189 | 189 | $result[] = $this->_rsm->isMixed |
| 190 | 190 | ? array($entityKey => null) |
| 191 | 191 | : null; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $resultKey = $this->_resultCounter - 1; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
| 249 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
| 250 | 250 | |
| 251 | 251 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
| 252 | 252 | $class = $newObject['class']; |
@@ -284,13 +284,13 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | if ($oneToOne) { |
| 287 | - $this->_resultPointers[$dqlAlias] =& $coll; |
|
| 287 | + $this->_resultPointers[$dqlAlias] = & $coll; |
|
| 288 | 288 | |
| 289 | 289 | return; |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | if ($index !== false) { |
| 293 | - $this->_resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 293 | + $this->_resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 294 | 294 | |
| 295 | 295 | return; |
| 296 | 296 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | end($coll); |
| 303 | - $this->_resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 303 | + $this->_resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 304 | 304 | |
| 305 | 305 | return; |
| 306 | 306 | } |
@@ -48,9 +48,9 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public static function emptyDiscriminatorValue($dqlAlias) |
| 50 | 50 | { |
| 51 | - return new self("The DQL alias '" . $dqlAlias . "' contains an entity ". |
|
| 52 | - "of an inheritance hierarchy with an empty discriminator value. This means " . |
|
| 53 | - "that the database contains inconsistent data with an empty " . |
|
| 51 | + return new self("The DQL alias '".$dqlAlias."' contains an entity ". |
|
| 52 | + "of an inheritance hierarchy with an empty discriminator value. This means ". |
|
| 53 | + "that the database contains inconsistent data with an empty ". |
|
| 54 | 54 | "discriminator value in a table row." |
| 55 | 55 | ); |
| 56 | 56 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $class->reflFields[$fieldName]->setValue($entity, $value); |
| 203 | 203 | $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value); |
| 204 | 204 | |
| 205 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 205 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 206 | 206 | } else if ( |
| 207 | 207 | isset($this->_hints[Query::HINT_REFRESH]) || |
| 208 | 208 | isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) && |
@@ -213,10 +213,10 @@ discard block |
||
| 213 | 213 | $value->setInitialized(true); |
| 214 | 214 | $value->unwrap()->clear(); |
| 215 | 215 | |
| 216 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 216 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 217 | 217 | } else { |
| 218 | 218 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
| 219 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
| 219 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | return $value; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $idHash = ''; |
| 290 | 290 | |
| 291 | 291 | foreach ($class->identifier as $fieldName) { |
| 292 | - $idHash .= ' ' . (isset($class->associationMappings[$fieldName]) |
|
| 292 | + $idHash .= ' '.(isset($class->associationMappings[$fieldName]) |
|
| 293 | 293 | ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] |
| 294 | 294 | : $data[$fieldName]); |
| 295 | 295 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias]; |
| 343 | 343 | // we need the $path to save into the identifier map which entities were already |
| 344 | 344 | // seen for this parent-child relationship |
| 345 | - $path = $parentAlias . '.' . $dqlAlias; |
|
| 345 | + $path = $parentAlias.'.'.$dqlAlias; |
|
| 346 | 346 | |
| 347 | 347 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
| 348 | 348 | if ( ! isset($nonemptyComponents[$parentAlias])) { |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | $reflFieldValue = $reflField->getValue($parentObject); |
| 383 | 383 | |
| 384 | 384 | if (isset($nonemptyComponents[$dqlAlias])) { |
| 385 | - $collKey = $oid . $relationField; |
|
| 385 | + $collKey = $oid.$relationField; |
|
| 386 | 386 | if (isset($this->initializedCollections[$collKey])) { |
| 387 | 387 | $reflFieldValue = $this->initializedCollections[$collKey]; |
| 388 | 388 | } else if ( ! isset($this->existingCollections[$collKey])) { |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | // PATH B: Single-valued association |
| 431 | 431 | $reflFieldValue = $reflField->getValue($parentObject); |
| 432 | 432 | |
| 433 | - if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) { |
|
| 433 | + if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized__)) { |
|
| 434 | 434 | // we only need to take action if this value is null, |
| 435 | 435 | // we refresh the entity or its an unitialized proxy. |
| 436 | 436 | if (isset($nonemptyComponents[$dqlAlias])) { |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
| 476 | 476 | |
| 477 | 477 | // if this row has a NULL value for the root result id then make it a null result. |
| 478 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 478 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 479 | 479 | if ($this->_rsm->isMixed) { |
| 480 | 480 | $result[] = array($entityKey => null); |
| 481 | 481 | } else { |
@@ -531,13 +531,13 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | - if ( ! isset($resultKey) ) { |
|
| 534 | + if ( ! isset($resultKey)) { |
|
| 535 | 535 | $this->resultCounter++; |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | // Append scalar values to mixed result sets |
| 539 | 539 | if (isset($rowData['scalars'])) { |
| 540 | - if ( ! isset($resultKey) ) { |
|
| 540 | + if ( ! isset($resultKey)) { |
|
| 541 | 541 | $resultKey = (isset($this->_rsm->indexByMap['scalars'])) |
| 542 | 542 | ? $row[$this->_rsm->indexByMap['scalars']] |
| 543 | 543 | : $this->resultCounter - 1; |
@@ -550,19 +550,19 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | // Append new object to mixed result sets |
| 552 | 552 | if (isset($rowData['newObjects'])) { |
| 553 | - if ( ! isset($resultKey) ) { |
|
| 553 | + if ( ! isset($resultKey)) { |
|
| 554 | 554 | $resultKey = $this->resultCounter - 1; |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | |
| 558 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
| 558 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
| 559 | 559 | |
| 560 | 560 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
| 561 | 561 | $class = $newObject['class']; |
| 562 | 562 | $args = $newObject['args']; |
| 563 | 563 | $obj = $class->newInstanceArgs($args); |
| 564 | 564 | |
| 565 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
| 565 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
| 566 | 566 | $result[$resultKey] = $obj; |
| 567 | 567 | |
| 568 | 568 | continue; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | : $value; |
| 300 | 300 | |
| 301 | 301 | if ($cacheKeyInfo['isIdentifier'] && $value !== null) { |
| 302 | - $id[$dqlAlias] .= '|' . $value; |
|
| 302 | + $id[$dqlAlias] .= '|'.$value; |
|
| 303 | 303 | $nonemptyComponents[$dqlAlias] = true; |
| 304 | 304 | } |
| 305 | 305 | break; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | if ( ! isset($cacheKeyInfo['isScalar'])) { |
| 338 | 338 | $dqlAlias = $cacheKeyInfo['dqlAlias']; |
| 339 | 339 | $type = $cacheKeyInfo['type']; |
| 340 | - $fieldName = $dqlAlias . '_' . $fieldName; |
|
| 340 | + $fieldName = $dqlAlias.'_'.$fieldName; |
|
| 341 | 341 | $value = $type |
| 342 | 342 | ? $type->convertToPHPValue($value, $this->_platform) |
| 343 | 343 | : $value; |
@@ -105,6 +105,6 @@ |
||
| 105 | 105 | */ |
| 106 | 106 | public function valid() |
| 107 | 107 | { |
| 108 | - return ($this->_current!=false); |
|
| 108 | + return ($this->_current != false); |
|
| 109 | 109 | } |
| 110 | 110 | } |
@@ -715,9 +715,9 @@ |
||
| 715 | 715 | ); |
| 716 | 716 | } |
| 717 | 717 | |
| 718 | - /** |
|
| 719 | - * {@inheritdoc} |
|
| 720 | - */ |
|
| 718 | + /** |
|
| 719 | + * {@inheritdoc} |
|
| 720 | + */ |
|
| 721 | 721 | protected function getHash() |
| 722 | 722 | { |
| 723 | 723 | return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts. |
| 42 | 42 | */ |
| 43 | - const STATE_CLEAN = 1; |
|
| 43 | + const STATE_CLEAN = 1; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * A query object is in state DIRTY when it has DQL parts that have not yet been |
@@ -707,11 +707,11 @@ discard block |
||
| 707 | 707 | ->getName(); |
| 708 | 708 | |
| 709 | 709 | return md5( |
| 710 | - $this->getDql() . serialize($this->_hints) . |
|
| 711 | - '&platform=' . $platform . |
|
| 712 | - ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '') . |
|
| 713 | - '&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults . |
|
| 714 | - '&hydrationMode=' . $this->_hydrationMode . '&types=' . serialize($this->_parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT' |
|
| 710 | + $this->getDql().serialize($this->_hints). |
|
| 711 | + '&platform='.$platform. |
|
| 712 | + ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : ''). |
|
| 713 | + '&firstResult='.$this->_firstResult.'&maxResult='.$this->_maxResults. |
|
| 714 | + '&hydrationMode='.$this->_hydrationMode.'&types='.serialize($this->_parsedTypes).'DOCTRINE_QUERY_CACHE_SALT' |
|
| 715 | 715 | ); |
| 716 | 716 | } |
| 717 | 717 | |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | */ |
| 721 | 721 | protected function getHash() |
| 722 | 722 | { |
| 723 | - return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults); |
|
| 723 | + return sha1(parent::getHash().'-'.$this->_firstResult.'-'.$this->_maxResults); |
|
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | /** |
@@ -620,7 +620,7 @@ |
||
| 620 | 620 | * Executes the query and returns an IterableResult that can be used to incrementally |
| 621 | 621 | * iterated over the result. |
| 622 | 622 | * |
| 623 | - * @param ArrayCollection|array|null $parameters The query parameters. |
|
| 623 | + * @param null|ArrayCollection $parameters The query parameters. |
|
| 624 | 624 | * @param integer $hydrationMode The hydration mode to use. |
| 625 | 625 | * |
| 626 | 626 | * @return \Doctrine\ORM\Internal\Hydration\IterableResult |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function referenceColumnName() |
| 102 | 102 | { |
| 103 | - return $this->case === CASE_UPPER ? 'ID' : 'id'; |
|
| 103 | + return $this->case === CASE_UPPER ? 'ID' : 'id'; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function joinColumnName($propertyName, $className = null) |
| 110 | 110 | { |
| 111 | - return $this->underscore($propertyName) . '_' . $this->referenceColumnName(); |
|
| 111 | + return $this->underscore($propertyName).'_'.$this->referenceColumnName(); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) |
| 118 | 118 | { |
| 119 | - return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity); |
|
| 119 | + return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
| 126 | 126 | { |
| 127 | - return $this->classToTableName($entityName) . '_' . |
|
| 127 | + return $this->classToTableName($entityName).'_'. |
|
| 128 | 128 | ($referencedColumnName ?: $this->referenceColumnName()); |
| 129 | 129 | } |
| 130 | 130 | |