@@ 1434-1442 (lines=9) @@ | ||
1431 | if ($columnsList !== null) { |
|
1432 | $joinSql = ''; |
|
1433 | $parentFks = $this->getParentRelationshipForeignKeys($mainTable); |
|
1434 | foreach ($parentFks as $fk) { |
|
1435 | $joinSql .= sprintf(' JOIN %s ON (%s.%s = %s.%s)', |
|
1436 | $this->connection->quoteIdentifier($fk->getForeignTableName()), |
|
1437 | $this->connection->quoteIdentifier($fk->getLocalTableName()), |
|
1438 | $this->connection->quoteIdentifier($fk->getLocalColumns()[0]), |
|
1439 | $this->connection->quoteIdentifier($fk->getForeignTableName()), |
|
1440 | $this->connection->quoteIdentifier($fk->getForeignColumns()[0]) |
|
1441 | ); |
|
1442 | } |
|
1443 | ||
1444 | $childrenFks = $this->getChildrenRelationshipForeignKeys($mainTable); |
|
1445 | foreach ($childrenFks as $fk) { |
|
@@ 1445-1453 (lines=9) @@ | ||
1442 | } |
|
1443 | ||
1444 | $childrenFks = $this->getChildrenRelationshipForeignKeys($mainTable); |
|
1445 | foreach ($childrenFks as $fk) { |
|
1446 | $joinSql .= sprintf(' LEFT JOIN %s ON (%s.%s = %s.%s)', |
|
1447 | $this->connection->quoteIdentifier($fk->getLocalTableName()), |
|
1448 | $this->connection->quoteIdentifier($fk->getForeignTableName()), |
|
1449 | $this->connection->quoteIdentifier($fk->getForeignColumns()[0]), |
|
1450 | $this->connection->quoteIdentifier($fk->getLocalTableName()), |
|
1451 | $this->connection->quoteIdentifier($fk->getLocalColumns()[0]) |
|
1452 | ); |
|
1453 | } |
|
1454 | ||
1455 | $sql = 'SELECT '.implode(', ', $columnsList).' FROM ('.$sql.') AS '.$mainTable.' '.$joinSql; |
|
1456 | } |