src/Contao/View/Contao2BackendView/ActionHandler/ToggleHandler.php
private function getModelId(EnvironmentInterface $environment)
    {
        $inputProvider = $environment->getInputProvider();

        if ($inputProvider->hasParameter('id') && $inputProvider->getParameter('id')) {
            $modelId = ModelId::fromSerialized($inputProvider->getParameter('id'));
        }

        if (!(isset($modelId)
              && ($environment->getDataDefinition()->getName() === $modelId->getDataProviderName()))
        ) {
            return null;
        }

        return $modelId;
    }
private function getModelId(EnvironmentInterface $environment)
    {
        $inputProvider = $environment->getInputProvider();

        if ($inputProvider->hasParameter('id') && $inputProvider->getParameter('id')) {
            $modelId = ModelId::fromSerialized($inputProvider->getParameter('id'));
        }

        if (!(isset($modelId)
              && ($environment->getDataDefinition()->getName() === $modelId->getDataProviderName()))
        ) {
            return null;
        }

        return $modelId;
    }
private function getModelId ( EnvironmentInterface $ environment ) { $ inputProvider = $ environment -> getInputProvider ( ) ; if ( $ inputProvider -> hasParameter ( 'id' ) && $ inputProvider -> getParameter ( 'id' ) ) { $ modelId = ModelId :: fromSerialized ( $ inputProvider -> getParameter ( 'id' ) ) ; } if ( ! ( isset ( $ modelId ) && ( $ environment -> getDataDefinition ( ) -> getName ( ) === $ modelId -> getDataProviderName ( ) ) ) ) { return null ; } return $ modelId ; }
Retrieve the model id from the input provider and validate it.

@param EnvironmentInterface $environment The environment.

@return ModelIdInterface|null
Retrieve the model id from the input provider and validate it .