public function serialize(Comment $comment, array $options = [])
    {
        return [
            'id' => $comment->getUuid(),
            'message' => $comment->getMessage(),
            'creationDate' => $comment->getCreationDate() ? DateNormalizer::normalize($comment->getCreationDate()) : null,
            'updateDate' => $comment->getUpdateDate() ? DateNormalizer::normalize($comment->getUpdateDate()) : null,
            'publicationDate' => $comment->getPublicationDate() ? DateNormalizer::normalize($comment->getPublicationDate()) : null,
            'author' => $comment->getAuthor() ? $this->userSerializer->serialize($comment->getAuthor()) : null,
            'authorName' => null !== $comment->getAuthor() ? $comment->getAuthor()->getFullName() : null,
            'authorPicture' => null !== $comment->getAuthor() ? $comment->getAuthor()->getPicture() : null,
            'isPublished' => $comment->isPublished(),
            'reported' => $comment->getReported(),
        ];
    }
public function serialize(Comment $comment, array $options = [])
    {
        return [
            'id' => $comment->getUuid(),
            'message' => $comment->getMessage(),
            'creationDate' => $comment->getCreationDate() ? DateNormalizer::normalize($comment->getCreationDate()) : null,
            'updateDate' => $comment->getUpdateDate() ? DateNormalizer::normalize($comment->getUpdateDate()) : null,
            'publicationDate' => $comment->getPublicationDate() ? DateNormalizer::normalize($comment->getPublicationDate()) : null,
            'author' => $comment->getAuthor() ? $this->userSerializer->serialize($comment->getAuthor()) : null,
            'authorName' => null !== $comment->getAuthor() ? $comment->getAuthor()->getFullName() : null,
            'authorPicture' => null !== $comment->getAuthor() ? $comment->getAuthor()->getPicture() : null,
            'isPublished' => $comment->isPublished(),
            'reported' => $comment->getReported(),
        ];
    }
public function serialize ( Comment $ comment , array $ options = [ ] ) { return [ 'id' => $ comment -> getUuid ( ) , 'message' => $ comment -> getMessage ( ) , 'creationDate' => $ comment -> getCreationDate ( ) ? DateNormalizer :: normalize ( $ comment -> getCreationDate ( ) ) : null , 'updateDate' => $ comment -> getUpdateDate ( ) ? DateNormalizer :: normalize ( $ comment -> getUpdateDate ( ) ) : null , 'publicationDate' => $ comment -> getPublicationDate ( ) ? DateNormalizer :: normalize ( $ comment -> getPublicationDate ( ) ) : null , 'author' => $ comment -> getAuthor ( ) ? $ this -> userSerializer -> serialize ( $ comment -> getAuthor ( ) ) : null , 'authorName' => null !== $ comment -> getAuthor ( ) ? $ comment -> getAuthor ( ) -> getFullName ( ) : null , 'authorPicture' => null !== $ comment -> getAuthor ( ) ? $ comment -> getAuthor ( ) -> getPicture ( ) : null , 'isPublished' => $ comment -> isPublished ( ) , 'reported' => $ comment -> getReported ( ) , ] ; }
Serialize a post comment.

@param Comment $comment
@param array   $options

@return array - The serialized representation of a comment
Serialize a post comment .