public function toggleVisibility(CategoryToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $category = $event->getCategory();

        $category
            ->setDispatcher($dispatcher)
            ->setVisible($category->getVisible() ? false : true)
            ->save()
            ;

        $event->setCategory($category);
    }
public function toggleVisibility(CategoryToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $category = $event->getCategory();

        $category
            ->setDispatcher($dispatcher)
            ->setVisible($category->getVisible() ? false : true)
            ->save()
            ;

        $event->setCategory($category);
    }
public function toggleVisibility ( CategoryToggleVisibilityEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { $ category = $ event -> getCategory ( ) ; $ category -> setDispatcher ( $ dispatcher ) -> setVisible ( $ category -> getVisible ( ) ? false : true ) -> save ( ) ; $ event -> setCategory ( $ category ) ; }
Toggle category visibility. No form used here

@param CategoryToggleVisibilityEvent $event
@param $eventName
@param EventDispatcherInterface $dispatcher
Toggle category visibility . No form used here