| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function validate($value, Constraint $constraint) { |
||
| 17 | if (!isset($value)) { |
||
| 18 | return; |
||
| 19 | } |
||
| 20 | $slideshowItems = $value->get($constraint->sourceFieldName); |
||
| 21 | foreach ($slideshowItems as $item) { |
||
| 22 | $itemBundle = \Drupal::entityTypeManager()->getStorage('media')->load($item->target_id)->bundle(); |
||
| 23 | if ($itemBundle == "gallery") { |
||
| 24 | $this->context->addViolation($constraint->message); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 30 |