|
@@ 92-100 (lines=9) @@
|
| 89 |
|
if ($columnsList !== null) { |
| 90 |
|
$joinSql = ''; |
| 91 |
|
$parentFks = $this->getParentRelationshipForeignKeys($this->mainTable); |
| 92 |
|
foreach ($parentFks as $fk) { |
| 93 |
|
$joinSql .= sprintf(' JOIN %s ON (%s.%s = %s.%s)', |
| 94 |
|
$connection->quoteIdentifier($fk->getForeignTableName()), |
| 95 |
|
$connection->quoteIdentifier($fk->getLocalTableName()), |
| 96 |
|
$connection->quoteIdentifier($fk->getLocalColumns()[0]), |
| 97 |
|
$connection->quoteIdentifier($fk->getForeignTableName()), |
| 98 |
|
$connection->quoteIdentifier($fk->getForeignColumns()[0]) |
| 99 |
|
); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
$childrenFks = $this->getChildrenRelationshipForeignKeys($this->mainTable); |
| 103 |
|
foreach ($childrenFks as $fk) { |
|
@@ 103-111 (lines=9) @@
|
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
$childrenFks = $this->getChildrenRelationshipForeignKeys($this->mainTable); |
| 103 |
|
foreach ($childrenFks as $fk) { |
| 104 |
|
$joinSql .= sprintf(' LEFT JOIN %s ON (%s.%s = %s.%s)', |
| 105 |
|
$connection->quoteIdentifier($fk->getLocalTableName()), |
| 106 |
|
$connection->quoteIdentifier($fk->getForeignTableName()), |
| 107 |
|
$connection->quoteIdentifier($fk->getForeignColumns()[0]), |
| 108 |
|
$connection->quoteIdentifier($fk->getLocalTableName()), |
| 109 |
|
$connection->quoteIdentifier($fk->getLocalColumns()[0]) |
| 110 |
|
); |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
$sql = 'SELECT '.implode(', ', $columnsList).' FROM ('.$sql.') AS '.$this->mainTable.' '.$joinSql; |
| 114 |
|
if (!empty($orderString)) { |