context = $context; } /** * @param \Tool\AModule $module * @param string $hookname * Attach module $module to $hookName * Can only be called while installing the module. * When fired, the AModule::doAction($hookName, $context) function will be called. **/ public function register($module, $hookName) { if (!\Tools\ModuleManager::isInstalling()) throw new \Exception("You can only register hooks while installing"); //TODO@2 } /** * @param string $hookName * fire the hook hookName * call the AModule::doAction($hookName, $context) function for each attached modules **/ public function trigger($hookName) { echo "Triggering hook `{$hookName}'"; //TODO@2 } /** * @param array(\Entity\ModuleHook) $module_hookEntities entities to load * Reload hooks from entities **/ public function loadHooks($hookEntities) { } }