6 * Interface HookInterface
9 * This interface allows CRM_BAO classes to subscribe to hooks.
10 * Simply create an eponymous hook function (e.g. `hook_civicrm_post()`).
13 * class CRM_Foo_BAO_Bar implements \Civi\Core\HookInterface {
14 * public function hook_civicrm_post($op, $objectName, $objectId, &$objectRef) {
15 * echo "Running hook_civicrm_post\n";
20 * Similarly, to subscribe using Symfony-style listeners, create function with the 'on_' prefix:
23 * class CRM_Foo_BAO_Bar implements \Civi\Core\HookInterface {
24 * public function on_civi_api_authorize(AuthorizeEvent $e): void {
25 * echo "Running civi.api.authorize\n";
27 * public function on_hook_civicrm_post(GenericHookEvent $e): void {
28 * echo "Running hook_civicrm_post\n";
33 * If you need more advanced registration abilities, consider using `Civi::dispatcher()`
34 * or `EventDispatcherInterface`.
36 * @see \Civi\Core\Event\EventScanner::findListeners
38 interface HookInterface
{