Пример #1
0
 public function deleteModuleHook(ModuleHookDeleteEvent $event)
 {
     if (null !== ($moduleHook = ModuleHookQuery::create()->findPk($event->getModuleHookId()))) {
         $moduleHook->delete();
         $event->setModuleHook($moduleHook);
         $this->cacheClear($event->getDispatcher());
     }
 }
Пример #2
0
 public function deleteModuleHook(ModuleHookDeleteEvent $event)
 {
     if (null !== ($moduleHook = ModuleHookQuery::create()->findPk($event->getModuleHookId()))) {
         $moduleHook->delete();
         $event->setModuleHook($moduleHook);
         // Prevent hook recreation by RegisterListenersPass::registerHook()
         // We store the method here to be able to retreive it when
         // we need to get all hook declared by a module
         $imh = new IgnoredModuleHook();
         $imh->setModuleId($moduleHook->getModuleId())->setHookId($moduleHook->getHookId())->setMethod($moduleHook->getMethod())->setClassname($moduleHook->getClassname())->save();
         $this->cacheClear($event->getDispatcher());
     }
 }