protected function serializePagination($pagination)
    {
        if ($this->serializedPagination !== null) {
            return $this->serializedPagination;
        }
        /** @var \yii\rest\Serializer $serializer */
        $serializer = $this->serializer;
        return $this->serializedPagination = [
            $serializer->linksEnvelope => \yii\web\Link::serialize($pagination->getLinks(true)),
            $serializer->metaEnvelope => [
                'totalCount' => $pagination->totalCount,
                'pageCount' => $pagination->getPageCount(),
                'currentPage' => $pagination->getPage() + 1,
                'perPage' => $pagination->getPageSize(),
            ],
        ];
    }
protected function serializePagination($pagination)
    {
        if ($this->serializedPagination !== null) {
            return $this->serializedPagination;
        }
        /** @var \yii\rest\Serializer $serializer */
        $serializer = $this->serializer;
        return $this->serializedPagination = [
            $serializer->linksEnvelope => \yii\web\Link::serialize($pagination->getLinks(true)),
            $serializer->metaEnvelope => [
                'totalCount' => $pagination->totalCount,
                'pageCount' => $pagination->getPageCount(),
                'currentPage' => $pagination->getPage() + 1,
                'perPage' => $pagination->getPageSize(),
            ],
        ];
    }
protected function serializePagination ( $ pagination ) { if ( $ this -> serializedPagination !== null ) { return $ this -> serializedPagination ; } /** @var \yii\rest\Serializer $serializer */ $ serializer = $ this -> serializer ; return $ this -> serializedPagination = [ $ serializer -> linksEnvelope => \ yii \ web \ Link :: serialize ( $ pagination -> getLinks ( true ) ) , $ serializer -> metaEnvelope => [ 'totalCount' => $ pagination -> totalCount , 'pageCount' => $ pagination -> getPageCount ( ) , 'currentPage' => $ pagination -> getPage ( ) + 1 , 'perPage' => $ pagination -> getPageSize ( ) , ] , ] ; }
Serializes a pagination into an array.
@param \yii\data\Pagination $pagination
@return array the array representation of the pagination
@see addPaginationHeaders()
Serializes a pagination into an array .