Esempio n. 1
0
 public function removeCountry(AreaRemoveCountryEvent $event)
 {
     CountryAreaQuery::create()->filterByCountryId($event->getCountryId())->filterByAreaId($event->getAreaId())->delete();
     if (null !== ($area = AreaQuery::create()->findPk($event->getAreaId()))) {
         $event->setArea($area);
     }
 }
Esempio n. 2
0
 public function removeCountry(AreaRemoveCountryEvent $event)
 {
     if (null !== ($country = CountryQuery::create()->findPk($event->getCountryId()))) {
         $event->setArea($country->getArea());
         $country->setDispatcher($event->getDispatcher());
         $country->setAreaId(null)->save();
     }
 }