title | footer |
---|---|
\leantime\core\events |
false |
- Full name:
\leantime\core\events
Dispatches an event to be executed somewhere
public static events::dispatch_event(string $eventName, mixed $payload = [], string $context = ''): void
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
eventName |
string | |
payload |
mixed | |
context |
string |
Return Value:
Dispatches a filter to manipulate a variable somewhere
public static events::dispatch_filter(string $filtername, mixed $payload = '', mixed $available_params = [], mixed $context = ''): mixed
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
filtername |
string | |
payload |
mixed | |
available_params |
mixed | |
context |
mixed |
Return Value:
Finds all the event and filter listeners and registers them (should only be executed once at the beginning of the program)
public static events::discover_listeners(): void
- This method is static.
Return Value:
Adds an event listener to be registered
public static events::add_event_listener(string $eventName, string|callable|object $handler, int $priority = 10): void
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
eventName |
string | |
handler |
**string | callable |
priority |
int |
Return Value:
Adds a filter listener to be registered
public static events::add_filter_listener(string $filtername, string|callable|object $handler, int $priority = 10): void
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
filtername |
string | |
handler |
**string | callable |
priority |
int |
Return Value:
Gets all registered listeners
public static events::get_registries(): array
- This method is static.
Return Value:
Gets all available hooks
public static events::get_available_hooks(): array
- This method is static.
Return Value:
Sorts listeners by priority for a given hook and type
private static events::sortByPriority(string $type, string $hookName): void
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
type |
string | |
hookName |
string |
Return Value:
Adds the current_route to the event's/filter's available params
private static events::defineParams(mixed $paramAttr): array|object
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
paramAttr |
mixed |
Return Value:
Executes all the handlers for a given hook
private static events::executeHandlers(array $registry, string $hookName, mixed $payload, array|object $available_params = []): array|object
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
registry |
array | |
hookName |
string | |
payload |
mixed | |
available_params |
**array | object** |
Return Value:
Automatically generated from source code comments on 2023-02-28 using phpDocumentor