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