Exemplo n.º 1
0
 /**
  * Delete a product feature entry
  *
  * @param FeatureAvDeleteEvent $event
  * @param $eventName
  * @param EventDispatcherInterface $dispatcher
  */
 public function delete(FeatureAvDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     if (null !== ($feature = FeatureAvQuery::create()->findPk($event->getFeatureAvId()))) {
         $feature->setDispatcher($dispatcher)->delete();
         $event->setFeatureAv($feature);
     }
 }
Exemplo n.º 2
0
 /**
  * Delete a product feature entry
  *
  * @param FeatureAvDeleteEvent $event
  */
 public function delete(FeatureAvDeleteEvent $event)
 {
     if (null !== ($feature = FeatureAvQuery::create()->findPk($event->getFeatureAvId()))) {
         $feature->setDispatcher($event->getDispatcher())->delete();
         $event->setFeatureAv($feature);
     }
 }
Exemplo n.º 3
0
 /**
  * @param FeatureAvModel $featureAv
  * @depends testUpdate
  */
 public function testDelete(FeatureAvModel $featureAv)
 {
     $event = new FeatureAvDeleteEvent($featureAv->getId());
     $event->setDispatcher($this->dispatcher);
     $action = new FeatureAv();
     $action->delete($event);
     $deletedFeatureAv = $event->getFeatureAv();
     $this->assertInstanceOf('Thelia\\Model\\FeatureAv', $deletedFeatureAv);
     $this->assertTrue($deletedFeatureAv->isDeleted());
 }