Code Duplication    Length = 8-10 lines in 2 locations

src/Gallery.php 2 locations

@@ 66-73 (lines=8) @@
63
        /**@var integer $count quantity images in additional field gallery */
64
        $count = 0;
65
66
        if ($this->hasImages()) {
67
            // Getting quantity images for gallery
68
            $count = $this->query
69
                ->entity(CMS::MATERIAL_IMAGES_RELATION_ENTITY)
70
                ->where(Field::F_DELETION, 1)
71
                ->where(MaterialField::F_PRIMARY, $this->materialFieldId)
72
                ->count();
73
        }
74
75
        return $count;
76
    }
@@ 88-97 (lines=10) @@
85
        /**@var $hasImages */
86
        $hasImages = false;
87
88
        if (isset($this->materialFieldId)) {
89
            // Getting quantity images, if quantity more 0 then material has images
90
            if ($this->query
91
            ->entity(CMS::MATERIAL_IMAGES_RELATION_ENTITY)
92
            ->where(Field::F_DELETION, 1)
93
            ->where(MaterialField::F_PRIMARY, $this->materialFieldId)
94
            ->count() > 0) {
95
                $hasImages = true;
96
            }
97
        }
98
99
        return $hasImages;
100
    }