Model/MediaResponse.php
public function jsonSerialize()
    {
        $json = parent::jsonSerialize();

        if (null !== $this->mediaId) {
            $json['mediaId'] = $this->mediaId;
        }
        if (null !== $this->thumbPreviewStatus) {
            $json['thumbPreviewStatus'] = $this->thumbPreviewStatus;
        }
        if (null !== $this->extension) {
            $json['extension'] = $this->extension;
        }
        if (null !== $this->metadata && !empty($this->metadata)) {
            $json['metadata'] = $this->metadata;
        }
        if (null !== $this->mimetype) {
            $json['mimetype'] = $this->mimetype;
        }
        if (null !== $this->size) {
            $json['size'] = $this->size;
        }
        if (null !== $this->statusId) {
            $json['statusId'] = $this->statusId;
        }
        if (null !== $this->uploaded) {
            $json['uploaded'] = $this->uploaded->format(\DateTime::ISO8601);
        }
        if (null !== $this->uploadedBy) {
            $json['uploadedBy'] = $this->uploadedBy;
        }
        if (null !== $this->deployedFiles && !empty($this->deployedFiles)) {
            $json['deployedFiles'] = $this->deployedFiles;
        }
        if (null !== $this->commentCount) {
            $json['commentCount'] = $this->commentCount;
        }
        if (null !== $this->rating) {
            $json['rating'] = $this->rating;
        }
        if (null !== $this->childMedias && !empty($this->childMedias)) {
            $json['childMedias'] = $this->childMedias;
        }
        if (null !== $this->objectId) {
            $json['objectId'] = $this->objectId;
        }
        if (null !== $this->created) {
            $json['created'] = $this->created->format(\DateTime::ISO8601);
        }
        if (null !== $this->createdBy) {
            $json['createdBy'] = $this->createdBy;
        }
        if (null !== $this->updated) {
            $json['updated'] = $this->updated->format(\DateTime::ISO8601);
        }
        if (null !== $this->updatedBy) {
            $json['updatedBy'] = $this->updatedBy;
        }
        if (null !== $this->dirty) {
            $json['dirty'] = $this->dirty;
        }
        if (null !== $this->propertySets && !empty($this->propertySets)) {
            $json['propertySets'] = $this->propertySets;
        }
        if (null !== $this->discriminatorId) {
            $json['discriminatorId'] = $this->discriminatorId;
        }

        foreach ($this->propertySets as $propertySet) {
            /** @var PropertySet $propertySet */
            foreach ($propertySet->getProperties() as $property) {
                /** @var Property $property */
                if (!isset($json['properties'][$property->getPropertyType()->getSystemName()])) {
                    if ($property->getValue() instanceof \DateTime) {
                        $json['properties'][$property->getPropertyType()->getSystemName()] = $property->getValue()->format(\DateTime::ISO8601);
                    } else {
                        $json['properties'][$property->getPropertyType()->getSystemName()] = $property->getValue();
                    }
                }
            }
        }

        return $json;
    }
public function jsonSerialize()
    {
        $json = parent::jsonSerialize();

        if (null !== $this->mediaId) {
            $json['mediaId'] = $this->mediaId;
        }
        if (null !== $this->thumbPreviewStatus) {
            $json['thumbPreviewStatus'] = $this->thumbPreviewStatus;
        }
        if (null !== $this->extension) {
            $json['extension'] = $this->extension;
        }
        if (null !== $this->metadata && !empty($this->metadata)) {
            $json['metadata'] = $this->metadata;
        }
        if (null !== $this->mimetype) {
            $json['mimetype'] = $this->mimetype;
        }
        if (null !== $this->size) {
            $json['size'] = $this->size;
        }
        if (null !== $this->statusId) {
            $json['statusId'] = $this->statusId;
        }
        if (null !== $this->uploaded) {
            $json['uploaded'] = $this->uploaded->format(\DateTime::ISO8601);
        }
        if (null !== $this->uploadedBy) {
            $json['uploadedBy'] = $this->uploadedBy;
        }
        if (null !== $this->deployedFiles && !empty($this->deployedFiles)) {
            $json['deployedFiles'] = $this->deployedFiles;
        }
        if (null !== $this->commentCount) {
            $json['commentCount'] = $this->commentCount;
        }
        if (null !== $this->rating) {
            $json['rating'] = $this->rating;
        }
        if (null !== $this->childMedias && !empty($this->childMedias)) {
            $json['childMedias'] = $this->childMedias;
        }
        if (null !== $this->objectId) {
            $json['objectId'] = $this->objectId;
        }
        if (null !== $this->created) {
            $json['created'] = $this->created->format(\DateTime::ISO8601);
        }
        if (null !== $this->createdBy) {
            $json['createdBy'] = $this->createdBy;
        }
        if (null !== $this->updated) {
            $json['updated'] = $this->updated->format(\DateTime::ISO8601);
        }
        if (null !== $this->updatedBy) {
            $json['updatedBy'] = $this->updatedBy;
        }
        if (null !== $this->dirty) {
            $json['dirty'] = $this->dirty;
        }
        if (null !== $this->propertySets && !empty($this->propertySets)) {
            $json['propertySets'] = $this->propertySets;
        }
        if (null !== $this->discriminatorId) {
            $json['discriminatorId'] = $this->discriminatorId;
        }

        foreach ($this->propertySets as $propertySet) {
            /** @var PropertySet $propertySet */
            foreach ($propertySet->getProperties() as $property) {
                /** @var Property $property */
                if (!isset($json['properties'][$property->getPropertyType()->getSystemName()])) {
                    if ($property->getValue() instanceof \DateTime) {
                        $json['properties'][$property->getPropertyType()->getSystemName()] = $property->getValue()->format(\DateTime::ISO8601);
                    } else {
                        $json['properties'][$property->getPropertyType()->getSystemName()] = $property->getValue();
                    }
                }
            }
        }

        return $json;
    }
Gets all data that should be available in a json representation.

@return array an associative array of the available variables