src/Contao/View/Contao2BackendView/ActionHandler/ToggleHandler.php
private function getOperation(Action $action, EnvironmentInterface $environment)
    {
        /** @var Contao2BackendViewDefinitionInterface $definition */
        $definition = $environment->getDataDefinition()->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $name       = $action->getName();
        $commands   = $definition->getModelCommands();

        if (!$commands->hasCommandNamed($name)) {
            return null;
        }

        return $commands->getCommandNamed($name);
    }
private function getOperation(Action $action, EnvironmentInterface $environment)
    {
        /** @var Contao2BackendViewDefinitionInterface $definition */
        $definition = $environment->getDataDefinition()->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $name       = $action->getName();
        $commands   = $definition->getModelCommands();

        if (!$commands->hasCommandNamed($name)) {
            return null;
        }

        return $commands->getCommandNamed($name);
    }
private function getOperation ( Action $ action , EnvironmentInterface $ environment ) { /** @var Contao2BackendViewDefinitionInterface $definition */ $ definition = $ environment -> getDataDefinition ( ) -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ; $ name = $ action -> getName ( ) ; $ commands = $ definition -> getModelCommands ( ) ; if ( ! $ commands -> hasCommandNamed ( $ name ) ) { return null ; } return $ commands -> getCommandNamed ( $ name ) ; }
Retrieve the toggle operation being executed.

@param Action               $action      The action.
@param EnvironmentInterface $environment The environment.

@return CommandInterface
Retrieve the toggle operation being executed .