Пример #1
0
 public function delete(CountryDeleteEvent $event)
 {
     if (null !== ($country = CountryQuery::create()->findPk($event->getCountryId()))) {
         $country->delete();
         $event->setCountry($country);
     }
 }
Пример #2
0
 /**
  * @param CountryModel $country
  * @depends testUpdate
  */
 public function testDelete(CountryModel $country)
 {
     $event = new CountryDeleteEvent($country->getId());
     $event->setDispatcher($this->dispatcher);
     $action = new Country();
     $action->delete($event);
     $deletedCountry = $event->getCountry();
     $this->assertInstanceOf('Thelia\\Model\\Country', $deletedCountry);
     $this->assertTrue($deletedCountry->isDeleted());
 }