src/Contao/View/Contao2BackendView/ActionHandler/DeleteHandler.php
protected function fetchModel(EnvironmentInterface $environment, ModelIdInterface $modelId)
    {
        $dataProvider = $environment->getDataProvider($modelId->getDataProviderName());
        $model        = $dataProvider->fetch($dataProvider->getEmptyConfig()->setId($modelId->getId()));

        if (!$model || !$model->getId()) {
            throw new DcGeneralRuntimeException(
                'Could not load model with id ' . $modelId->getSerialized()
            );
        }

        return $model;
    }
protected function fetchModel(EnvironmentInterface $environment, ModelIdInterface $modelId)
    {
        $dataProvider = $environment->getDataProvider($modelId->getDataProviderName());
        $model        = $dataProvider->fetch($dataProvider->getEmptyConfig()->setId($modelId->getId()));

        if (!$model || !$model->getId()) {
            throw new DcGeneralRuntimeException(
                'Could not load model with id ' . $modelId->getSerialized()
            );
        }

        return $model;
    }
protected function fetchModel ( EnvironmentInterface $ environment , ModelIdInterface $ modelId ) { $ dataProvider = $ environment -> getDataProvider ( $ modelId -> getDataProviderName ( ) ) ; $ model = $ dataProvider -> fetch ( $ dataProvider -> getEmptyConfig ( ) -> setId ( $ modelId -> getId ( ) ) ) ; if ( ! $ model || ! $ model -> getId ( ) ) { throw new DcGeneralRuntimeException ( 'Could not load model with id ' . $ modelId -> getSerialized ( ) ) ; } return $ model ; }
Fetch the model.

@param EnvironmentInterface $environment The environment.
@param ModelIdInterface     $modelId     The model id.

@return ModelInterface

@throws DcGeneralRuntimeException If model is not found.
Fetch the model .