/** * 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); }
/** * 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); }