protected function transformDataProvider(DataProviderInterface $dataProvider)
    {
        if (Craft::$app->getRequest()->getIsHead()) {
            return null;
        } else {
            if (!$transformer = $this->dataTransformer()) {
                return $dataProvider;
            }

            // The transformed data
            $models = Factory::collection(
                $this->resolveTransformer($transformer),
                $dataProvider->getModels(),
                $this->getTransformConfig()
            );

            if ($this->collectionEnvelope === null) {
                return $models;
            } else {
                return [
                    $this->collectionEnvelope => $models,
                ];
            }
        }
    }
protected function transformDataProvider(DataProviderInterface $dataProvider)
    {
        if (Craft::$app->getRequest()->getIsHead()) {
            return null;
        } else {
            if (!$transformer = $this->dataTransformer()) {
                return $dataProvider;
            }

            // The transformed data
            $models = Factory::collection(
                $this->resolveTransformer($transformer),
                $dataProvider->getModels(),
                $this->getTransformConfig()
            );

            if ($this->collectionEnvelope === null) {
                return $models;
            } else {
                return [
                    $this->collectionEnvelope => $models,
                ];
            }
        }
    }
protected function transformDataProvider ( DataProviderInterface $ dataProvider ) { if ( Craft :: $ app -> getRequest ( ) -> getIsHead ( ) ) { return null ; } else { if ( ! $ transformer = $ this -> dataTransformer ( ) ) { return $ dataProvider ; } // The transformed data $ models = Factory :: collection ( $ this -> resolveTransformer ( $ transformer ) , $ dataProvider -> getModels ( ) , $ this -> getTransformConfig ( ) ) ; if ( $ this -> collectionEnvelope === null ) { return $ models ; } else { return [ $ this -> collectionEnvelope => $ models , ] ; } } }
Serializes a data provider.
@param DataProviderInterface $dataProvider
@return array|DataProviderInterface the array representation of the data provider.
Serializes a data provider .