예제 #1
0
 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());
     }
 }
예제 #2
0
파일: Hook.php 프로젝트: alex63530/thelia
 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());
     }
 }