Code Duplication    Length = 8-8 lines in 2 locations

src/Material.php 2 locations

@@ 303-310 (lines=8) @@
300
301
        /** @var \samson\activerecord\structurematerial[] $objects Create structure material relations */
302
        $objects = array();
303
        if (dbQuery('structurematerial')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
304
            foreach ($objects as $cmsNavigation) {
305
                /** @var \samson\activerecord\Record $copy */
306
                $copy = $cmsNavigation->copy();
307
                $copy->MaterialID = $clone->id;
308
                $copy->save();
309
            }
310
        }
311
        /** @var \samson\activerecord\materialfield[] $objects Create material field relations */
312
        $objects = array();
313
        if (dbQuery('materialfield')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
@@ 327-334 (lines=8) @@
324
325
        /** @var \samson\activerecord\gallery[] $objects Create gallery field relations */
326
        $objects = array();
327
        if (dbQuery('gallery')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
328
            foreach ($objects as $cmsGallery) {
329
                /** @var \samson\activerecord\Record $copy */
330
                $copy = $cmsGallery->copy();
331
                $copy->MaterialID = $clone->id;
332
                $copy->save();
333
            }
334
        }
335
336
        return $clone;
337
    }