|
@@ -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
|
} |