示例#1
0
文件: Country.php 项目: zorn-v/thelia
 /**
  * Toggle Country visibility
  *
  * @param CountryToggleVisibilityEvent $event
  */
 public function toggleVisibility(CountryToggleVisibilityEvent $event)
 {
     $country = $event->getCountry();
     $country->setDispatcher($event->getDispatcher())->setVisible(!$country->getVisible())->save();
     $event->setCountry($country);
 }
示例#2
0
 /**
  * Toggle Country visibility
  *
  * @param CountryToggleVisibilityEvent $event
  * @param $eventName
  * @param EventDispatcherInterface $dispatcher
  */
 public function toggleVisibility(CountryToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     $country = $event->getCountry();
     $country->setDispatcher($dispatcher)->setVisible(!$country->getVisible())->save();
     $event->setCountry($country);
 }