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