protected function getSerializedResponse($action, $result, $params)
    {
        $dataProvider = null;
        if ($result instanceof DataProviderInterface) {
            $dataProvider = $result;
        } elseif (isset($result['dataProvider']) && $result['dataProvider'] instanceof DataProviderInterface) {
            $dataProvider = $result['dataProvider'];
        }
        if ($dataProvider !== null
            && ($dataProvider->getPagination() !== false
                || $dataProvider->getTotalCount() >= self::SERIALIZATION_LIMIT)
            && $dataProvider->getPagination()->getPageSize() >= self::SERIALIZATION_LIMIT
        ) {
            return false;
        }

        if (isset($result['dataProvider'])) {
            $data = $result['dataProvider'];
        } elseif (isset($result['model'])) {
            $data = $result['model'];
        } else {
            $data = $result;
        }
        $data = parent::afterAction($action, $data);
        return Yii::createObject($this->serializer)->serialize($data);
    }
protected function getSerializedResponse($action, $result, $params)
    {
        $dataProvider = null;
        if ($result instanceof DataProviderInterface) {
            $dataProvider = $result;
        } elseif (isset($result['dataProvider']) && $result['dataProvider'] instanceof DataProviderInterface) {
            $dataProvider = $result['dataProvider'];
        }
        if ($dataProvider !== null
            && ($dataProvider->getPagination() !== false
                || $dataProvider->getTotalCount() >= self::SERIALIZATION_LIMIT)
            && $dataProvider->getPagination()->getPageSize() >= self::SERIALIZATION_LIMIT
        ) {
            return false;
        }

        if (isset($result['dataProvider'])) {
            $data = $result['dataProvider'];
        } elseif (isset($result['model'])) {
            $data = $result['model'];
        } else {
            $data = $result;
        }
        $data = parent::afterAction($action, $data);
        return Yii::createObject($this->serializer)->serialize($data);
    }
protected function getSerializedResponse ( $ action , $ result , $ params ) { $ dataProvider = null ; if ( $ result instanceof DataProviderInterface ) { $ dataProvider = $ result ; } elseif ( isset ( $ result [ 'dataProvider' ] ) && $ result [ 'dataProvider' ] instanceof DataProviderInterface ) { $ dataProvider = $ result [ 'dataProvider' ] ; } if ( $ dataProvider !== null && ( $ dataProvider -> getPagination ( ) !== false || $ dataProvider -> getTotalCount ( ) >= self :: SERIALIZATION_LIMIT ) && $ dataProvider -> getPagination ( ) -> getPageSize ( ) >= self :: SERIALIZATION_LIMIT ) { return false ; } if ( isset ( $ result [ 'dataProvider' ] ) ) { $ data = $ result [ 'dataProvider' ] ; } elseif ( isset ( $ result [ 'model' ] ) ) { $ data = $ result [ 'model' ] ; } else { $ data = $ result ; } $ data = parent :: afterAction ( $ action , $ data ) ; return Yii :: createObject ( $ this -> serializer ) -> serialize ( $ data ) ; }
Returns a serialized dataProvider or model if the response does NOT contain
a dataProvider with large pages or pagination disabled and large number of items.
@param Action $action the action just executed.
@param mixed $result  the action return result.
@param array $params params extracted from result
@return array serialized dataProvider or model or boolean false if response contains a large dataProvider.
@throws \yii\base\InvalidConfigException
Returns a serialized dataProvider or model if the response does NOT contain a dataProvider with large pages or pagination disabled and large number of items .