Completed
Pull Request — 4.0 (#84)
by Jean-Baptiste
05:44
created
src/Mouf/Database/TDBM/TDBMService.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
      * This is used internally by TDBM to add an object to the list of objects that have been
582 582
      * created/updated but not saved yet.
583 583
      *
584
-     * @param AbstractTDBMObject $myObject
584
+     * @param DbRow $myObject
585 585
      */
586 586
     public function _addToToSaveObjectList(DbRow $myObject)
587 587
     {
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
     /**
1333 1333
      * Returns the column list that must be fetched for the SQL request.
1334 1334
      *
1335
-     * @param $mainTable
1335
+     * @param string $mainTable
1336 1336
      * @param array $additionalTablesFetch
1337 1337
      *
1338 1338
      * @return array
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
     }
1388 1388
 
1389 1389
     /**
1390
-     * @param $table
1390
+     * @param string $table
1391 1391
      * @param array  $primaryKeys
1392 1392
      * @param array  $additionalTablesFetch
1393 1393
      * @param bool   $lazy                  Whether to perform lazy loading on this object or not.
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
      * @param $pivotTableName
1592 1592
      * @param AbstractTDBMObject $bean
1593 1593
      *
1594
-     * @return AbstractTDBMObject[]
1594
+     * @return ResultIterator
1595 1595
      */
1596 1596
     public function _getRelatedBeans($pivotTableName, AbstractTDBMObject $bean)
1597 1597
     {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
         sort($tables);
1027 1027
 
1028 1028
         return $this->fromCache($this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables),
1029
-            function () use ($tables) {
1029
+            function() use ($tables) {
1030 1030
                 return $this->_getLinkBetweenInheritedTablesWithoutCache($tables);
1031 1031
             });
1032 1032
     }
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
      */
1074 1074
     public function _getRelatedTablesByInheritance($table)
1075 1075
     {
1076
-        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) {
1076
+        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) {
1077 1077
             return $this->_getRelatedTablesByInheritanceWithoutCache($table);
1078 1078
         });
1079 1079
     }
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
         $objects = $this->findObjects($mainTable, $filter, $parameters, null, $additionalTablesFetch, self::MODE_ARRAY, $className);
1458 1458
         $page = $objects->take(0, 2);
1459 1459
         $count = $page->count();
1460
-        if ($count > 1) {
1460
+        if ($count>1) {
1461 1461
             throw new DuplicateRowException("Error while querying an object for table '$mainTable': More than 1 row have been returned, but we should have received at most one.");
1462 1462
         } elseif ($count === 0) {
1463 1463
             return;
@@ -1484,7 +1484,7 @@  discard block
 block discarded – undo
1484 1484
         $objects = $this->findObjectsFromSql($mainTable, $from, $filter, $parameters, null, self::MODE_ARRAY, $className);
1485 1485
         $page = $objects->take(0, 2);
1486 1486
         $count = $page->count();
1487
-        if ($count > 1) {
1487
+        if ($count>1) {
1488 1488
             throw new DuplicateRowException("Error while querying an object for table '$mainTable': More than 1 row have been returned, but we should have received at most one.");
1489 1489
         } elseif ($count === 0) {
1490 1490
             return;
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
         $remoteTable = $remoteFk->getForeignTableName();
1602 1602
 
1603 1603
         $primaryKeys = $this->getPrimaryKeyValues($bean);
1604
-        $columnNames = array_map(function ($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns());
1604
+        $columnNames = array_map(function($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns());
1605 1605
 
1606 1606
         $filter = array_combine($columnNames, $primaryKeys);
1607 1607
 
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
         $table1 = $fks[0]->getForeignTableName();
1623 1623
         $table2 = $fks[1]->getForeignTableName();
1624 1624
 
1625
-        $beanTables = array_map(function (DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows());
1625
+        $beanTables = array_map(function(DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows());
1626 1626
 
1627 1627
         if (in_array($table1, $beanTables)) {
1628 1628
             return [$fks[0], $fks[1]];
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
     {
1679 1679
         if (!isset($typesForTable[$tableName])) {
1680 1680
             $columns = $this->tdbmSchemaAnalyzer->getSchema()->getTable($tableName)->getColumns();
1681
-            $typesForTable[$tableName] = array_map(function (Column $column) {
1681
+            $typesForTable[$tableName] = array_map(function(Column $column) {
1682 1682
                 return $column->getType();
1683 1683
             }, $columns);
1684 1684
         }
Please login to merge, or discard this patch.