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

        if (null !== $this->id) {
            $json['id'] = $this->id;
        }
        if (null !== $this->createdBy) {
            $json['createdBy'] = $this->createdBy;
        }
        if (null !== $this->created) {
            $json['created'] = $this->created->format(\DateTime::ISO8601);
        }
        if (null !== $this->replies && !empty($this->replies)) {
            $json['replies'] = $this->replies;
        }

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

        if (null !== $this->id) {
            $json['id'] = $this->id;
        }
        if (null !== $this->createdBy) {
            $json['createdBy'] = $this->createdBy;
        }
        if (null !== $this->created) {
            $json['created'] = $this->created->format(\DateTime::ISO8601);
        }
        if (null !== $this->replies && !empty($this->replies)) {
            $json['replies'] = $this->replies;
        }

        return $json;
    }
public function jsonSerialize ( ) { $ json = parent :: jsonSerialize ( ) ; if ( null !== $ this -> id ) { $ json [ 'id' ] = $ this -> id ; } if ( null !== $ this -> createdBy ) { $ json [ 'createdBy' ] = $ this -> createdBy ; } if ( null !== $ this -> created ) { $ json [ 'created' ] = $ this -> created -> format ( \ DateTime :: ISO8601 ) ; } if ( null !== $ this -> replies && ! empty ( $ this -> replies ) ) { $ json [ 'replies' ] = $ this -> replies ; } return $ json ; }
Gets all data that should be available in a json representation.

@return array an associative array of the available variables
Gets all data that should be available in a json representation .