Conditions | 5 |
Paths | 5 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function validate($value, Constraint $constraint) { |
||
17 | if (!isset($value)) { |
||
18 | return; |
||
19 | } |
||
20 | if ($value->hasField($constraint->sourceFieldName)) { |
||
21 | $slideshowItems = $value->get($constraint->sourceFieldName); |
||
22 | foreach ($slideshowItems as $item) { |
||
23 | if ($item->entity->getType()->getPluginId() == "slideshow") { |
||
24 | $this->context->addViolation($constraint->message); |
||
25 | } |
||
26 | } |
||
27 | } |
||
28 | } |
||
29 | |||
31 |