Code Duplication    Length = 9-9 lines in 2 locations

src/Relation/OneToMany.php 1 location

@@ 55-63 (lines=9) @@
52
    }
53
54
    /** {@inheritdoc} */
55
    public function addJoin(EntityFetcher $fetcher, $join, $alias)
56
    {
57
        $expression = [];
58
        foreach ($this->getOpponent()->getReference() as $hisVar => $myVar) {
59
            $expression[] = $alias . '.' . $myVar . ' = ' . $this->name . '.' . $hisVar;
60
        }
61
62
        call_user_func([ $fetcher, $join ], $this->class, implode(' AND ', $expression), $this->name, [], true);
63
    }
64
}
65

src/Relation/Owner.php 1 location

@@ 78-86 (lines=9) @@
75
    }
76
77
    /** {@inheritdoc} */
78
    public function addJoin(EntityFetcher $fetcher, $join, $alias)
79
    {
80
        $expression = [];
81
        foreach ($this->reference as $myVar => $hisVar) {
82
            $expression[] = $alias . '.' . $myVar . ' = ' . $this->name . '.' . $hisVar;
83
        }
84
85
        call_user_func([ $fetcher, $join ], $this->class, implode(' AND ', $expression), $this->name, [], true);
86
    }
87
}
88