1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Core\Concern; |
4: | |
5: | use Salient\Contract\Core\StoppableEventInterface; |
6: | |
7: | /** |
8: | * Implements IStoppableEvent |
9: | * |
10: | * @see StoppableEventInterface |
11: | */ |
12: | trait StoppableEventTrait |
13: | { |
14: | protected bool $Propagate = true; |
15: | |
16: | /** |
17: | * @inheritDoc |
18: | */ |
19: | public function isPropagationStopped(): bool |
20: | { |
21: | return !$this->Propagate; |
22: | } |
23: | |
24: | /** |
25: | * @return $this |
26: | */ |
27: | public function stopPropagation() |
28: | { |
29: | $this->Propagate = false; |
30: | return $this; |
31: | } |
32: | } |
33: |