Code Duplication    Length = 8-8 lines in 2 locations

src/Material.php 2 locations

@@ 393-400 (lines=8) @@
390
391
        /** @var \samson\activerecord\structurematerial[] $objects Create structure material relations */
392
        $objects = array();
393
        if (dbQuery('structurematerial')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
394
            foreach ($objects as $cmsNavigation) {
395
                /** @var \samson\activerecord\Record $copy */
396
                $copy = $cmsNavigation->copy();
397
                $copy->MaterialID = $clone->id;
398
                $copy->save();
399
            }
400
        }
401
        /** @var \samson\activerecord\materialfield[] $objects Create material field relations */
402
        $objects = array();
403
        if (dbQuery('materialfield')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
@@ 417-424 (lines=8) @@
414
415
        /** @var \samson\activerecord\gallery[] $objects Create gallery field relations */
416
        $objects = array();
417
        if (dbQuery('gallery')->cond('MaterialID', $this->MaterialID)->exec($objects)) {
418
            foreach ($objects as $cmsGallery) {
419
                /** @var \samson\activerecord\Record $copy */
420
                $copy = $cmsGallery->copy();
421
                $copy->MaterialID = $clone->id;
422
                $copy->save();
423
            }
424
        }
425
426
        return $clone;
427
    }