示例#1
0
 public function delete(HookDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     if (null !== ($hook = HookQuery::create()->findPk($event->getHookId()))) {
         $hook->delete();
         $event->setHook($hook);
         $this->cacheClear($dispatcher);
     }
 }
示例#2
0
文件: Hook.php 项目: alex63530/thelia
 public function delete(HookDeleteEvent $event)
 {
     if (null !== ($hook = HookQuery::create()->findPk($event->getHookId()))) {
         $hook->delete();
         $event->setHook($hook);
         $this->cacheClear($event->getDispatcher());
     }
 }
示例#3
0
 /**
  * @params HookModel $hook
  * @depends testUpdate
  */
 public function testDelete(HookModel $hook)
 {
     $event = new HookDeleteEvent($hook->getId());
     $event->setDispatcher($this->dispatcher);
     $hookAction = $this->action->delete($event);
     $deletedHook = $event->getHook();
     $this->assertInstanceOf('Thelia\\Model\\Hook', $deletedHook);
     $this->assertTrue($deletedHook->isDeleted());
 }