Beispiel #1
0
 /**
  * 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);
 }
Beispiel #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);
 }