src/Controller/Ajax3X.php
protected function getModelFromSerializedId($serializedId)
    {
        $modelId      = ModelId::fromSerialized($serializedId);
        $dataProvider = $this->getEnvironment()->getDataProvider($modelId->getDataProviderName());
        $model        = $dataProvider->fetch($dataProvider->getEmptyConfig()->setId($modelId->getId()));

        if (null === $model) {
            $event = new LogEvent(
                'A record with the ID "' . $serializedId . '" does not exist in "' .
                $this->getEnvironment()->getDataDefinition()->getName() . '"',
                'Ajax executePostActions()',
                TL_ERROR
            );
            $this->getEnvironment()->getEventDispatcher()->dispatch(ContaoEvents::SYSTEM_LOG, $event);

            throw new ResponseException(new Response(Response::$statusTexts[400], 400));
        }

        return $model;
    }
protected function getModelFromSerializedId($serializedId)
    {
        $modelId      = ModelId::fromSerialized($serializedId);
        $dataProvider = $this->getEnvironment()->getDataProvider($modelId->getDataProviderName());
        $model        = $dataProvider->fetch($dataProvider->getEmptyConfig()->setId($modelId->getId()));

        if (null === $model) {
            $event = new LogEvent(
                'A record with the ID "' . $serializedId . '" does not exist in "' .
                $this->getEnvironment()->getDataDefinition()->getName() . '"',
                'Ajax executePostActions()',
                TL_ERROR
            );
            $this->getEnvironment()->getEventDispatcher()->dispatch(ContaoEvents::SYSTEM_LOG, $event);

            throw new ResponseException(new Response(Response::$statusTexts[400], 400));
        }

        return $model;
    }
protected function getModelFromSerializedId ( $ serializedId ) { $ modelId = ModelId :: fromSerialized ( $ serializedId ) ; $ dataProvider = $ this -> getEnvironment ( ) -> getDataProvider ( $ modelId -> getDataProviderName ( ) ) ; $ model = $ dataProvider -> fetch ( $ dataProvider -> getEmptyConfig ( ) -> setId ( $ modelId -> getId ( ) ) ) ; if ( null === $ model ) { $ event = new LogEvent ( 'A record with the ID "' . $ serializedId . '" does not exist in "' . $ this -> getEnvironment ( ) -> getDataDefinition ( ) -> getName ( ) . '"' , 'Ajax executePostActions()' , TL_ERROR ) ; $ this -> getEnvironment ( ) -> getEventDispatcher ( ) -> dispatch ( ContaoEvents :: SYSTEM_LOG , $ event ) ; throw new ResponseException ( new Response ( Response :: $ statusTexts [ 400 ] , 400 ) ) ; } return $ model ; }
Retrieve a model from a serialized id.

Exits the script if no model has been found.

@param string $serializedId The serialized id.

@return ModelInterface

@throws ResponseException Throws a response exception.
Retrieve a model from a serialized id .