Controller/WebsiteArticleController.php
protected function serializeArticle(ArticleInterface $object, $pageNumber)
    {
        return $this->get('jms_serializer')->serialize(
            $object,
            'array',
            SerializationContext::create()
                ->setSerializeNull(true)
                ->setGroups(['website', 'content'])
                ->setAttribute('website', true)
                ->setAttribute('pageNumber', $pageNumber)
        );
    }
protected function serializeArticle(ArticleInterface $object, $pageNumber)
    {
        return $this->get('jms_serializer')->serialize(
            $object,
            'array',
            SerializationContext::create()
                ->setSerializeNull(true)
                ->setGroups(['website', 'content'])
                ->setAttribute('website', true)
                ->setAttribute('pageNumber', $pageNumber)
        );
    }
protected function serializeArticle ( ArticleInterface $ object , $ pageNumber ) { return $ this -> get ( 'jms_serializer' ) -> serialize ( $ object , 'array' , SerializationContext :: create ( ) -> setSerializeNull ( true ) -> setGroups ( [ 'website' , 'content' ] ) -> setAttribute ( 'website' , true ) -> setAttribute ( 'pageNumber' , $ pageNumber ) ) ; }
Serialize given article with page-number.

@param ArticleInterface $object
@param int $pageNumber

@return array
Serialize given article with page - number .