public static function invokeHook(string $hookId, array $arguments = array()): bool
    {
        $componentsUsingHook = self::getComponentsUsingHook($hookId);
        
        foreach ($componentsUsingHook as $addonComponent) {
            $addon = self::getComponentClassInstance($addonComponent->getIdentifier());
            if ($addon == null) {
                continue;
            }
            
            $function = $addonComponent->getHookWithId($hookId);
            
            if (($result = $addon->$function(...$arguments))) {
                return $result;
            }
        }
        
        return false;
    }
public static function invokeHook(string $hookId, array $arguments = array()): bool
    {
        $componentsUsingHook = self::getComponentsUsingHook($hookId);
        
        foreach ($componentsUsingHook as $addonComponent) {
            $addon = self::getComponentClassInstance($addonComponent->getIdentifier());
            if ($addon == null) {
                continue;
            }
            
            $function = $addonComponent->getHookWithId($hookId);
            
            if (($result = $addon->$function(...$arguments))) {
                return $result;
            }
        }
        
        return false;
    }
public static function invokeHook ( string $ hookId , array $ arguments = array ( ) ) : bool { $ componentsUsingHook = self :: getComponentsUsingHook ( $ hookId ) ; foreach ( $ componentsUsingHook as $ addonComponent ) { $ addon = self :: getComponentClassInstance ( $ addonComponent -> getIdentifier ( ) ) ; if ( $ addon == null ) { continue ; } $ function = $ addonComponent -> getHookWithId ( $ hookId ) ; if ( ( $ result = $ addon -> $ function ( ... $ arguments ) ) ) { return $ result ; } } return false ; }
Call a hook.
Invoking all functions configured for that hook depending on their result.

@link https://xentriqdocs.readthedocs.io/en/latest/addons/hooks.html

@param string $hookId
Identifier for the hook to call.

@param array $arguments
[optional]
Arguments to supply to the functions invoked by the hook.


@return bool Whether any of the hooks has returned true and stopped further invocation of further functions configured for the hook.
Call a hook . Invoking all functions configured for that hook depending on their result .