plugin/exo/Serializer/Item/ItemObjectSerializer.php
public function serialize(ItemObject $itemObject, array $options = [])
    {
        $serialized = [
            'id' => $itemObject->getUuid(),
            'type' => $itemObject->getMimeType(),
        ];

        if (1 === preg_match('#^text\/[^/]+$#', $itemObject->getMimeType())) {
            $serialized['data'] = $itemObject->getData();
        } else {
            $serialized['url'] = $itemObject->getData();
        }

        return $serialized;
    }
public function serialize(ItemObject $itemObject, array $options = [])
    {
        $serialized = [
            'id' => $itemObject->getUuid(),
            'type' => $itemObject->getMimeType(),
        ];

        if (1 === preg_match('#^text\/[^/]+$#', $itemObject->getMimeType())) {
            $serialized['data'] = $itemObject->getData();
        } else {
            $serialized['url'] = $itemObject->getData();
        }

        return $serialized;
    }
public function serialize ( ItemObject $ itemObject , array $ options = [ ] ) { $ serialized = [ 'id' => $ itemObject -> getUuid ( ) , 'type' => $ itemObject -> getMimeType ( ) , ] ; if ( 1 === preg_match ( '#^text\/[^/]+$#' , $ itemObject -> getMimeType ( ) ) ) { $ serialized [ 'data' ] = $ itemObject -> getData ( ) ; } else { $ serialized [ 'url' ] = $ itemObject -> getData ( ) ; } return $ serialized ; }
Converts a ItemObject into a JSON-encodable structure.

@param ItemObject $itemObject
@param array      $options

@return array
Converts a ItemObject into a JSON - encodable structure .