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