public function delete(HookDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher) { if (null !== ($hook = HookQuery::create()->findPk($event->getHookId()))) { $hook->delete(); $event->setHook($hook); $this->cacheClear($dispatcher); } }
public function delete(HookDeleteEvent $event) { if (null !== ($hook = HookQuery::create()->findPk($event->getHookId()))) { $hook->delete(); $event->setHook($hook); $this->cacheClear($event->getDispatcher()); } }
/** * @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()); }