Elgg  Version master
events.php
Go to the documentation of this file.
1 <?php
48 function elgg_register_event_handler(string $event, string $type, callable|string $callback, int $priority = 500): bool {
49  return _elgg_services()->events->registerHandler($event, $type, $callback, $priority);
50 }
51 
62 function elgg_unregister_event_handler(string $event, string $type, callable|string $callback): void {
63  _elgg_services()->events->unregisterHandler($event, $type, $callback);
64 }
65 
75 function elgg_clear_event_handlers(string $event, string $type): void {
76  _elgg_services()->events->clearHandlers($event, $type);
77 }
78 
102 function elgg_trigger_event(string $event, string $type, $object = null): bool {
103  return _elgg_services()->events->trigger($event, $type, $object);
104 }
105 
117 function elgg_trigger_event_results(string $event, string $type, array $params = [], $returnvalue = null) {
118  return _elgg_services()->events->triggerResults($event, $type, $params, $returnvalue);
119 }
120 
138 function elgg_trigger_before_event(string $event, string $type, $object = null): bool {
139  return _elgg_services()->events->triggerBefore($event, $type, $object);
140 }
141 
157 function elgg_trigger_after_event(string $event, string $type, $object = null): void {
158  _elgg_services()->events->triggerAfter($event, $type, $object);
159 }
160 
174 function elgg_trigger_deprecated_event(string $event, string $type, $object = null, string $message = '', string $version = '') {
175  return _elgg_services()->events->triggerDeprecated($event, $type, $object, $message, $version);
176 }
177 
192 function elgg_trigger_deprecated_event_results(string $event, string $type, array $params = [], $returnvalue = null, string $message = '', string $version = '') {
193  return _elgg_services()->events->triggerDeprecatedResults($event, $type, $params, $returnvalue, $message, $version);
194 }
elgg_register_event_handler(string $event, string $type, callable|string $callback, int $priority=500)
Helper functions for event handling.
Definition: events.php:48
elgg_unregister_event_handler(string $event, string $type, callable|string $callback)
Unregisters a callback for an event.
Definition: events.php:62
$params
Saves global plugin settings.
Definition: save.php:13
$version
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
elgg_trigger_deprecated_event_results(string $event, string $type, array $params=[], $returnvalue=null, string $message= '', string $version= '')
Triggers a deprecated event where it is expected that the mixed return value could be manipulated by ...
Definition: events.php:192
$type
Definition: delete.php:21
elgg_trigger_event_results(string $event, string $type, array $params=[], $returnvalue=null)
Triggers an event where it is expected that the mixed return value could be manipulated by event call...
Definition: events.php:117
elgg_trigger_after_event(string $event, string $type, $object=null)
Trigger an "After event" indicating a process has finished.
Definition: events.php:157
elgg_trigger_deprecated_event(string $event, string $type, $object=null, string $message= '', string $version= '')
Trigger an event normally, but send a notice about deprecated use if any handlers are registered...
Definition: events.php:174
elgg_trigger_before_event(string $event, string $type, $object=null)
Trigger a "Before event" indicating a process is about to begin.
Definition: events.php:138
elgg_clear_event_handlers(string $event, string $type)
Clears all callback registrations for a event.
Definition: events.php:75
if($email instanceof\Elgg\Email) $object
Definition: body.php:24
_elgg_services()
Get the global service provider.
Definition: elgglib.php:351
elgg_trigger_event(string $event, string $type, $object=null)
Trigger an Elgg Event and attempt to run all handler callbacks registered to that event...
Definition: events.php:102
$priority