public function toggleVisibility(StateToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $state = $event->getState();

        $state
            ->setDispatcher($dispatcher)
            ->setVisible(!$state->getVisible())
            ->save()
        ;

        $event->setState($state);
    }
public function toggleVisibility(StateToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $state = $event->getState();

        $state
            ->setDispatcher($dispatcher)
            ->setVisible(!$state->getVisible())
            ->save()
        ;

        $event->setState($state);
    }
public function toggleVisibility ( StateToggleVisibilityEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { $ state = $ event -> getState ( ) ; $ state -> setDispatcher ( $ dispatcher ) -> setVisible ( ! $ state -> getVisible ( ) ) -> save ( ) ; $ event -> setState ( $ state ) ; }
Toggle State visibility

@param StateToggleVisibilityEvent $event
Toggle State visibility