Skip to content

Commit 0e346c8

Browse files
committed
[TASK] Make new event stoppable
1 parent 7d02602 commit 0e346c8

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎Classes/Event/Document/GenerateDocumentEvent.php‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
*/
1313

1414
use Extcode\Cart\Domain\Model\Order\Item;
15+
use Psr\EventDispatcher\StoppableEventInterface;
1516

16-
final readonly class GenerateDocumentEvent
17+
final readonly class GenerateDocumentEvent implements StoppableEventInterface
1718
{
19+
private bool $isPropagationStopped = false;
20+
1821
public function __construct(
1922
private Item $orderItem,
2023
private string $type
@@ -30,4 +33,14 @@ public function getType(): string
3033
{
3134
return $this->type;
3235
}
36+
37+
public function setPropagationStopped(bool $isPropagationStopped): void
38+
{
39+
$this->isPropagationStopped = $isPropagationStopped;
40+
}
41+
42+
public function isPropagationStopped(): bool
43+
{
44+
return $this->isPropagationStopped;
45+
}
3346
}

0 commit comments

Comments
 (0)