Failed Conditions
Pull Request — 2.6 (#7882)
by
unknown
08:05
created
lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
 
346 346
         // FIXME: Order with composite keys might not be correct
347 347
         $sql = 'SELECT ' . $columnName
348
-             . ' FROM '  . $tableName
349
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
348
+                . ' FROM '  . $tableName
349
+                . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
350 350
 
351 351
 
352 352
         $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id);
@@ -495,8 +495,8 @@  discard block
 block discarded – undo
495 495
         }
496 496
 
497 497
         $sql = 'UPDATE ' . $quotedTableName
498
-             . ' SET ' . implode(', ', $set)
499
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
498
+                . ' SET ' . implode(', ', $set)
499
+                . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
500 500
 
501 501
         $result = $this->conn->executeUpdate($sql, $params, $types);
502 502
 
@@ -651,24 +651,24 @@  discard block
 block discarded – undo
651 651
                     // set $newVal = null, in order to insert a null value and schedule an
652 652
                     // extra update on the UnitOfWork.
653 653
                     // This is only required if the associated entity is different from the current one,
654
-	                // and if the current entity relies on the database to generate its id
655
-	                if ($newValue !== $entity) {
656
-	                    $scheduleExtraUpdate = true;
657
-	                } else {
658
-	                    $identifiers = $this->class->getIdentifier();
659
-	                    // Only single-column identifiers are supported
660
-	                    if (1 === count($identifiers) && isset($entityChangeSet[$identifiers[0]])) {
661
-	                        // Extra update is required if the current entity does not have yet a value for its identifier
662
-	                        $scheduleExtraUpdate = ($entityChangeSet[$identifiers[0]][1] === null);
663
-	                    } else {
664
-	                        $scheduleExtraUpdate = true;
665
-	                    }
666
-	                }
667
-
668
-	                if ($scheduleExtraUpdate) {
669
-	                    $uow->scheduleExtraUpdate($entity, [$field => [null, $newValue]]);
670
-	                    $newValue = null;
671
-	                }
654
+                    // and if the current entity relies on the database to generate its id
655
+                    if ($newValue !== $entity) {
656
+                        $scheduleExtraUpdate = true;
657
+                    } else {
658
+                        $identifiers = $this->class->getIdentifier();
659
+                        // Only single-column identifiers are supported
660
+                        if (1 === count($identifiers) && isset($entityChangeSet[$identifiers[0]])) {
661
+                            // Extra update is required if the current entity does not have yet a value for its identifier
662
+                            $scheduleExtraUpdate = ($entityChangeSet[$identifiers[0]][1] === null);
663
+                        } else {
664
+                            $scheduleExtraUpdate = true;
665
+                        }
666
+                    }
667
+
668
+                    if ($scheduleExtraUpdate) {
669
+                        $uow->scheduleExtraUpdate($entity, [$field => [null, $newValue]]);
670
+                        $newValue = null;
671
+                    }
672 672
                 }
673 673
             }
674 674
 
@@ -1548,9 +1548,9 @@  discard block
 block discarded – undo
1548 1548
         $lock  = $this->getLockTablesSql($lockMode);
1549 1549
         $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1550 1550
         $sql = 'SELECT 1 '
1551
-             . $lock
1552
-             . $where
1553
-             . $lockSql;
1551
+                . $lock
1552
+                . $where
1553
+                . $lockSql;
1554 1554
 
1555 1555
         list($params, $types) = $this->expandParameters($criteria);
1556 1556
 
@@ -2002,8 +2002,8 @@  discard block
 block discarded – undo
2002 2002
         $alias = $this->getSQLTableAlias($this->class->name);
2003 2003
 
2004 2004
         $sql = 'SELECT 1 '
2005
-             . $this->getLockTablesSql(null)
2006
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2005
+                . $this->getLockTablesSql(null)
2006
+                . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2007 2007
 
2008 2008
         list($params, $types) = $this->expandParameters($criteria);
2009 2009
 
@@ -2033,9 +2033,9 @@  discard block
 block discarded – undo
2033 2033
     {
2034 2034
         // if one of the join columns is nullable, return left join
2035 2035
         foreach ($joinColumns as $joinColumn) {
2036
-             if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) {
2037
-                 return 'LEFT JOIN';
2038
-             }
2036
+                if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) {
2037
+                    return 'LEFT JOIN';
2038
+                }
2039 2039
         }
2040 2040
 
2041 2041
         return 'INNER JOIN';
Please login to merge, or discard this patch.