container
3 days ago
observable
3 days ago
result
3 days ago
container.php
3 days ago
index.html
3 days ago
observable.php
3 days ago
observer.php
3 days ago
result.php
3 days ago
state.php
3 days ago
container.php
64 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | /** |
| 15 | * Action container interface. |
| 16 | * |
| 17 | * @since 1.7.3 |
| 18 | */ |
| 19 | interface VAPActionContainer |
| 20 | { |
| 21 | /** |
| 22 | * Attaches the specified observer to the given event. |
| 23 | * |
| 24 | * @param string $event The event to observe. |
| 25 | * @param VAPActionObserver $observer The subsriber instance. |
| 26 | * |
| 27 | * @return void |
| 28 | */ |
| 29 | public function attach($event, VAPActionObserver $observer); |
| 30 | |
| 31 | /** |
| 32 | * Detaches the specified observer from the given event. |
| 33 | * |
| 34 | * @param string $event The observed event. |
| 35 | * @param VAPActionObserver $observer The subsriber instance. |
| 36 | * |
| 37 | * @return boolean True in case of success. |
| 38 | */ |
| 39 | public function detach($event, VAPActionObserver $observer); |
| 40 | |
| 41 | /** |
| 42 | * Detaches all the same instances of the specified observer from the |
| 43 | * given event. In case the observer instance is omitted, the method |
| 44 | * will clear all the subscribers attached to the given event. |
| 45 | * |
| 46 | * @param string $event The observed event. |
| 47 | * @param VAPActionObserver $observer The subsriber instance. |
| 48 | * |
| 49 | * @return boolean True in case of success. |
| 50 | */ |
| 51 | public function detachAll($event, ?VAPActionObserver $observer = null); |
| 52 | |
| 53 | /** |
| 54 | * Notifies the subscribers every time the internal state of the |
| 55 | * given event changes. |
| 56 | * |
| 57 | * @param string $event The involved event. |
| 58 | * @param VAPActionState $data The state wrapper. |
| 59 | * |
| 60 | * @return VAPActionResult A list of results returned by the observers. |
| 61 | */ |
| 62 | public function notify($event, VAPActionState $state); |
| 63 | } |
| 64 |