/** * Toggle Brand visibility * * @param BrandToggleVisibilityEvent $event * @param string $eventName * @param EventDispatcherInterface $dispatcher * @throws \Exception * @throws \Propel\Runtime\Exception\PropelException */ public function toggleVisibility(BrandToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher) { $brand = $event->getBrand(); $brand->setDispatcher($dispatcher)->setVisible(!$brand->getVisible())->save(); $event->setBrand($brand); }
/** * Toggle Brand visibility * * @param BrandToggleVisibilityEvent $event */ public function toggleVisibility(BrandToggleVisibilityEvent $event) { $brand = $event->getBrand(); $brand->setDispatcher($event->getDispatcher())->setVisible(!$brand->getVisible())->save(); $event->setBrand($brand); }