Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | declare( strict_types=1 ); |
4 | |
5 | namespace MediaWiki\Extension\CampaignEvents\Event\Store; |
6 | |
7 | use MediaWiki\Extension\CampaignEvents\Event\EventRegistration; |
8 | use MediaWiki\Extension\CampaignEvents\Event\ExistingEventRegistration; |
9 | |
10 | /** |
11 | * Interface for the storage layer of event registrations. Methods in this interface are currently not expected to |
12 | * return a failure result, so any failure would have to be handled by throwing exceptions. |
13 | */ |
14 | interface IEventStore { |
15 | public const STORE_SERVICE_NAME = 'CampaignEventsEventStore'; |
16 | |
17 | /** |
18 | * @param EventRegistration $event |
19 | * @return int ID of the saved event. If $event has a non-null ID, then that value is returned. |
20 | */ |
21 | public function saveRegistration( EventRegistration $event ): int; |
22 | |
23 | /** |
24 | * @param ExistingEventRegistration $registration |
25 | * @return bool True if the event was just deleted, false if it was already deleted |
26 | */ |
27 | public function deleteRegistration( ExistingEventRegistration $registration ): bool; |
28 | } |