Model/Comment.php
public function jsonSerialize()
    {
        $json = [];

        if (null !== $this->objectId) {
            $json['objectId'] = $this->objectId;
        }
        if (null !== $this->comment) {
            $json['comment'] = $this->comment;
        }
        if (null !== $this->parentId) {
            $json['parentId'] = $this->parentId;
        }
        if (null !== $this->userName) {
            $json['userName'] = $this->userName;
        }
        if (null !== $this->userEmail) {
            $json['userEmail'] = $this->userEmail;
        }

        return $json;
    }
public function jsonSerialize()
    {
        $json = [];

        if (null !== $this->objectId) {
            $json['objectId'] = $this->objectId;
        }
        if (null !== $this->comment) {
            $json['comment'] = $this->comment;
        }
        if (null !== $this->parentId) {
            $json['parentId'] = $this->parentId;
        }
        if (null !== $this->userName) {
            $json['userName'] = $this->userName;
        }
        if (null !== $this->userEmail) {
            $json['userEmail'] = $this->userEmail;
        }

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

@return array an associative array of the available variables