| 1 | <?php |
||
| 7 | trait HasEvents |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Register a component event with the dispatcher. |
||
| 11 | * |
||
| 12 | * @param string $event |
||
| 13 | * @param \Closure|string $callback |
||
| 14 | * @return void |
||
| 15 | */ |
||
| 16 | protected static function registerEvent($event, $callback) |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Fire the given event for the component |
||
| 27 | * |
||
| 28 | * @param string $event |
||
| 29 | * @param bool $halt |
||
| 30 | * @return bool |
||
| 31 | */ |
||
| 32 | 36 | protected function fireEvent($event, $halt = true) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Get the event dispatcher instance. |
||
| 48 | * |
||
| 49 | * @return \Illuminate\Contracts\Events\Dispatcher |
||
| 50 | */ |
||
| 51 | public static function getEventDispatcher() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Set the event dispatcher instance. |
||
| 58 | * |
||
| 59 | * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher |
||
| 60 | * @return void |
||
| 61 | */ |
||
| 62 | 48 | public static function setEventDispatcher(Dispatcher $dispatcher) |
|
| 66 | } |
||
| 67 |