main/core/API/Serializer/MessageSerializer.php
public function serialize(AbstractMessage $message, array $options = [])
    {
        return [
            'id' => $message->getUuid(),
            'content' => $message->getContent(),
            'meta' => $this->serializeMeta($message),
            'parent' => $this->serializeParent($message),
            'children' => array_map(function (AbstractMessage $child) use ($options) {
                return $this->serialize($child, $options);
            }, $message->getChildren()->toArray()),
        ];
    }
public function serialize(AbstractMessage $message, array $options = [])
    {
        return [
            'id' => $message->getUuid(),
            'content' => $message->getContent(),
            'meta' => $this->serializeMeta($message),
            'parent' => $this->serializeParent($message),
            'children' => array_map(function (AbstractMessage $child) use ($options) {
                return $this->serialize($child, $options);
            }, $message->getChildren()->toArray()),
        ];
    }
public function serialize ( AbstractMessage $ message , array $ options = [ ] ) { return [ 'id' => $ message -> getUuid ( ) , 'content' => $ message -> getContent ( ) , 'meta' => $ this -> serializeMeta ( $ message ) , 'parent' => $ this -> serializeParent ( $ message ) , 'children' => array_map ( function ( AbstractMessage $ child ) use ( $ options ) { return $ this -> serialize ( $ child , $ options ) ; } , $ message -> getChildren ( ) -> toArray ( ) ) , ] ; }
Serializes a AbstractMessage entity.

@param AbstractMessage $message
@param array           $options

@return array
Serializes a AbstractMessage entity .