MediaWiki master
DomainEventSource.php
Go to the documentation of this file.
1<?php
3
11
28 public const INVOKE_AFTER_COMMIT = 'AfterCommit';
29
30 public const INVOCATION_MODE = 'invocation';
31
35 public const DEFAULT_LISTENER_OPTIONS = [
36 self::INVOCATION_MODE => self::INVOKE_AFTER_COMMIT
37 ];
38
54 public function registerListener(
55 string $eventType,
56 $listener,
57 array $options = self::DEFAULT_LISTENER_OPTIONS
58 ): void;
59
75 public function registerSubscriber( $subscriber ): void;
76
77}
Service object for registering listeners for domain events.
registerSubscriber( $subscriber)
Register the given subscriber to this event source.
const DEFAULT_LISTENER_OPTIONS
Default options to apply when registering listeners.
registerListener(string $eventType, $listener, array $options=self::DEFAULT_LISTENER_OPTIONS)
Add a listener that will be notified on events of the given type, triggered by changed to the persist...
const INVOKE_AFTER_COMMIT
Listeners will be invoked after the transaction that produced the event was committed successfully.