Code Duplication    Length = 9-9 lines in 2 locations

src/QueryFactory/FindObjectsFromSqlQueryFactory.php 2 locations

@@ 61-69 (lines=9) @@
58
        if (count($allFetchedTables) > 1) {
59
            $joinSql = '';
60
            $parentFks = $this->getParentRelationshipForeignKeys($this->mainTable);
61
            foreach ($parentFks as $fk) {
62
                $joinSql .= sprintf(
63
                    ' JOIN %s ON (%s.%s = %s.%s)',
64
                    $mySqlPlatform->quoteIdentifier($fk->getForeignTableName()),
65
                    $mySqlPlatform->quoteIdentifier($fk->getLocalTableName()),
66
                    $mySqlPlatform->quoteIdentifier($fk->getUnquotedLocalColumns()[0]),
67
                    $mySqlPlatform->quoteIdentifier($fk->getForeignTableName()),
68
                    $mySqlPlatform->quoteIdentifier($fk->getUnquotedForeignColumns()[0])
69
                );
70
            }
71
72
            $childrenFks = $this->getChildrenRelationshipForeignKeys($this->mainTable);
@@ 73-81 (lines=9) @@
70
            }
71
72
            $childrenFks = $this->getChildrenRelationshipForeignKeys($this->mainTable);
73
            foreach ($childrenFks as $fk) {
74
                $joinSql .= sprintf(
75
                    ' LEFT JOIN %s ON (%s.%s = %s.%s)',
76
                    $mySqlPlatform->quoteIdentifier($fk->getLocalTableName()),
77
                    $mySqlPlatform->quoteIdentifier($fk->getForeignTableName()),
78
                    $mySqlPlatform->quoteIdentifier($fk->getUnquotedForeignColumns()[0]),
79
                    $mySqlPlatform->quoteIdentifier($fk->getLocalTableName()),
80
                    $mySqlPlatform->quoteIdentifier($fk->getUnquotedLocalColumns()[0])
81
                );
82
            }
83
84
            $sql .= $joinSql;