Code Duplication    Length = 8-8 lines in 2 locations

src/Material.php 2 locations

@@ 192-199 (lines=8) @@
189
190
        /** @var \samson\activerecord\structurematerial[] $objects Create structure material relations */
191
        $objects = array();
192
        if (dbQuery('structurematerial')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
193
            foreach ($objects as $cmsNavigation) {
194
                /** @var \samson\activerecord\Record $copy */
195
                $copy = $cmsNavigation->copy();
196
                $copy->MaterialID = $clone->id;
197
                $copy->save();
198
            }
199
        }
200
        /** @var \samson\activerecord\materialfield[] $objects Create material field relations */
201
        $objects = array();
202
        if (dbQuery('materialfield')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
@@ 216-223 (lines=8) @@
213
214
        /** @var \samson\activerecord\gallery[] $objects Create gallery field relations */
215
        $objects = array();
216
        if (dbQuery('gallery')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
217
            foreach ($objects as $cmsGallery) {
218
                /** @var \samson\activerecord\Record $copy */
219
                $copy = $cmsGallery->copy();
220
                $copy->MaterialID = $clone->id;
221
                $copy->save();
222
            }
223
        }
224
225
        return $clone;
226
    }