UPDATE_EVENT
UPDATE_EVENT
Event::UPDATE_EVENT
Simple event management, allows for assigning callbacks instead of full functions to respond to events.
use Ceo\Core\Event;
// Register event handler
Event::register(Event::UPDATE_EVENT, function($emitter, $data) {
var_export($emitter);
...
});
// Create and fire event:
$e = (new Event)
->setType(Event::UPDATE_EVENT)
->setEmitter($myObject)
->setData(['myExtra' => 'stuff'])
->fire();
afterCreate(\Ceo\Core\Event $event, mixed $emitter, array $data = array()) : void
Handles Event::CREATE_EVENT
\Ceo\Core\Event | $event | |
mixed | $emitter | |
array | $data |
afterUpdate(\Ceo\Core\Event $event, mixed $emitter, array $data = array()) : void
Handles Event::UPDATE_EVENT
\Ceo\Core\Event | $event | |
mixed | $emitter | |
array | $data |
afterDelete(\Ceo\Core\Event $event, mixed $emitter, array $data = array()) : void
Handles Event::DELETE_EVENT
\Ceo\Core\Event | $event | |
mixed | $emitter | |
array | $data |
beforeNull(\Ceo\Core\Event $event, mixed $emitter, array $data = array()) : void
Handles Event::NULL_EVENT which doesn't fire anything
\Ceo\Core\Event | $event | |
mixed | $emitter | |
array | $data |