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

        if (null !== $this->id) {
            $json['id'] = $this->id;
        }
        if (null !== $this->subFolders && !empty($this->subFolders)) {
            $json['subFolders'] = $this->subFolders;
        }
        if (null !== $this->savedSearch) {
            $json['savedSearch'] = $this->savedSearch;
        }
        if (null !== $this->objectCount) {
            $json['objectCount'] = $this->objectCount;
        }
        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->id) {
            $json['id'] = $this->id;
        }
        if (null !== $this->subFolders && !empty($this->subFolders)) {
            $json['subFolders'] = $this->subFolders;
        }
        if (null !== $this->savedSearch) {
            $json['savedSearch'] = $this->savedSearch;
        }
        if (null !== $this->objectCount) {
            $json['objectCount'] = $this->objectCount;
        }
        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