private function getModelById($modelId)
    {
        if ($modelId === null) {
            return null;
        }

        $provider = $this->environment->getDataProvider();
        $config   = $provider
            ->getEmptyConfig()
            ->setId($modelId);

        return $provider->fetch($config);
    }
private function getModelById($modelId)
    {
        if ($modelId === null) {
            return null;
        }

        $provider = $this->environment->getDataProvider();
        $config   = $provider
            ->getEmptyConfig()
            ->setId($modelId);

        return $provider->fetch($config);
    }
private function getModelById ( $ modelId ) { if ( $ modelId === null ) { return null ; } $ provider = $ this -> environment -> getDataProvider ( ) ; $ config = $ provider -> getEmptyConfig ( ) -> setId ( $ modelId ) ; return $ provider -> fetch ( $ config ) ; }
Find a item by its id.

@param int $modelId The id to find.

@return ModelInterface
Find a item by its id .