| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function init() |
||
| 27 | { |
||
| 28 | Event::on( |
||
| 29 | Element::class, |
||
| 30 | Element::EVENT_REGISTER_ACTIONS, |
||
| 31 | function (RegisterElementActionsEvent $event) { |
||
| 32 | $event->actions = [ |
||
| 33 | [ |
||
| 34 | 'type' => DissociateFromElementAction::class, |
||
| 35 | 'sourceId' => $event->data['sourceId'] ?? null, |
||
| 36 | 'fieldId' => $event->data['fieldId'] ?? null |
||
| 37 | ] |
||
| 38 | ]; |
||
| 39 | }, |
||
| 40 | [ |
||
| 41 | 'sourceId' => $this->sourceId(), |
||
| 42 | 'fieldId' => $this->fieldId() |
||
| 43 | ] |
||
| 44 | ); |
||
| 45 | parent::init(); |
||
| 46 | } |
||
| 47 | |||
| 64 |