Code Duplication    Length = 9-9 lines in 3 locations

src/Mapper/Relation/AbstractRelation.php 1 location

@@ 154-162 (lines=9) @@
151
     *
152
     * @return string
153
     */
154
    public function getForeignKey()
155
    {
156
        if (is_null($this->foreignKey)) {
157
            $name = $this->getParentEntityDescriptor()->getTableName();
158
            $name = Text::singular(strtolower($name));
159
            $this->foreignKey = "{$name}_id";
160
        }
161
        return $this->foreignKey;
162
    }
163
164
    /**
165
     * Register the retrieved entities in the repository identity map

src/Mapper/Relation/HasOne.php 1 location

@@ 57-65 (lines=9) @@
54
     *
55
     * @return string
56
     */
57
    public function getForeignKey()
58
    {
59
        if (is_null($this->foreignKey)) {
60
            $name = $this->getEntityDescriptor()->getTableName();
61
            $name = Text::singular(strtolower($name));
62
            $this->foreignKey = "{$name}_id";
63
        }
64
        return $this->foreignKey;
65
    }
66
67
    /**
68
     * Loads the entity or entity collection for this relation

src/Mapper/Relation/HasMany.php 1 location

@@ 139-147 (lines=9) @@
136
     *
137
     * @return string
138
     */
139
    public function getForeignKey()
140
    {
141
        if (is_null($this->foreignKey)) {
142
            $name = $this->getEntityDescriptor()->getTableName();
143
            $name = Text::singular(strtolower($name));
144
            $this->foreignKey = "{$name}_id";
145
        }
146
        return $this->foreignKey;
147
    }
148
149
    /**
150
     * Check custom conditions