public function toggleHookActivation(HookToggleActivationEvent $event) { if ($event->hasHook()) { $hook = $event->getHook(); ModuleHookQuery::create()->filterByHookId($hook->getId())->update(array('HookActive' => $hook->getActivate())); $this->cacheClear($event->getDispatcher()); } }
public function toggleActivation(HookToggleActivationEvent $event) { if (null !== ($hook = HookQuery::create()->findPk($event->getHookId()))) { $hook->setActivate(!$hook->getActivate())->save(); $event->setHook($hook); $this->cacheClear($event->getDispatcher()); } }