callCustomEvent
This function allows the User to call a Custom Event. This enables flexibility and allows for modularization when creating Custom Logic.
mixed callCustomEvent(string $eventIdentifier, array $data)
Parameters
$eventIdentifier: The Custom Event Identifier.
$data: An array of data passed to the custom event
Return Values
The return Captures whatever is returned from inside the target Custom Event.
Example
// this is the Custom Event: myEvent $this->debug($data); return 'myEvent was called';
$result = $this->callCustomEvent('myEvent', ['some' => 'data']); // $result will equal "myEvent was called" // the debug tab on myEvent will show the $data array