Standards  1.0
Standard_Event_Interface Class Reference

Public Member Functions

 on ($params=[], callable $call)
 
 invoke ($params=[])
 

Data Fields

 $officialEvents
 
 params
 

Member Function Documentation

invoke (   $params = [])

This will invoke this event with the given $params

Returns
true if the event should be canceled or false if not.
on (   $params = [],
callable  $call 
)

This will listen on this event where the $params match.

Example:

Standards::ForumSystem()->event("thread.create")->on(//Listen to the thread.create event for ForumSystem
["forum" => function ($eventName, $forumEntity) { //Check the "forum" param with a function that looks for a "News" forum
if ($forumEntity->getName() == "News")
return true;
return false;
}],
function ($eventName, $params) {
//This code will be called when the event and params are a match.
return false; //This wll cancel this event.
}
);

Field Documentation

$officialEvents
Initial value:
= [
"ForumSystem.thread.create" => [
"description" => "When a forum thread is about to be created"

The documentation for this class was generated from the following file: