main/core/API/Serializer/Resource/ResourceCommentSerializer.php
public function serialize(ResourceComment $comment, array $options = [])
    {
        $serialized = [
            'id' => $comment->getUuid(),
            'content' => $comment->getContent(),
            'user' => $comment->getUser() ? $this->userSerializer->serialize($comment->getUser(), [Options::SERIALIZE_MINIMAL]) : null,
            'creationDate' => $comment->getCreationDate() ? DateNormalizer::normalize($comment->getCreationDate()) : null,
            'editionDate' => $comment->getEditionDate() ? DateNormalizer::normalize($comment->getEditionDate()) : null,
        ];

        return $serialized;
    }
public function serialize(ResourceComment $comment, array $options = [])
    {
        $serialized = [
            'id' => $comment->getUuid(),
            'content' => $comment->getContent(),
            'user' => $comment->getUser() ? $this->userSerializer->serialize($comment->getUser(), [Options::SERIALIZE_MINIMAL]) : null,
            'creationDate' => $comment->getCreationDate() ? DateNormalizer::normalize($comment->getCreationDate()) : null,
            'editionDate' => $comment->getEditionDate() ? DateNormalizer::normalize($comment->getEditionDate()) : null,
        ];

        return $serialized;
    }
public function serialize ( ResourceComment $ comment , array $ options = [ ] ) { $ serialized = [ 'id' => $ comment -> getUuid ( ) , 'content' => $ comment -> getContent ( ) , 'user' => $ comment -> getUser ( ) ? $ this -> userSerializer -> serialize ( $ comment -> getUser ( ) , [ Options :: SERIALIZE_MINIMAL ] ) : null , 'creationDate' => $ comment -> getCreationDate ( ) ? DateNormalizer :: normalize ( $ comment -> getCreationDate ( ) ) : null , 'editionDate' => $ comment -> getEditionDate ( ) ? DateNormalizer :: normalize ( $ comment -> getEditionDate ( ) ) : null , ] ; return $ serialized ; }
Serializes a ResourceComment entity for the JSON api.

@param ResourceComment $comment - the comment to serialize
@param array           $options

@return array - the serialized representation of the comment
Serializes a ResourceComment entity for the JSON api .