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

        if (null !== $this->id) {
            $json['id'] = $this->id;
        }
        if (null !== $this->name) {
            $json['name'] = $this->name;
        }
        if (null !== $this->email) {
            $json['email'] = $this->email;
        }
        if (null !== $this->endDate) {
            $json['endDate'] = $this->endDate->format(\DateTime::ISO8601);
        }
        if (null !== $this->startDate) {
            $json['startDate'] = $this->startDate->format(\DateTime::ISO8601);
        }
        if (null !== $this->firstName) {
            $json['firstName'] = $this->firstName;
        }
        if (null !== $this->lastName) {
            $json['lastName'] = $this->lastName;
        }
        if (null !== $this->userName) {
            $json['userName'] = $this->userName;
        }
        if (null !== $this->lastLogin) {
            $json['lastLogin'] = $this->lastLogin->format(\DateTime::ISO8601);
        }
        if (null !== $this->groups && !empty($this->groups)) {
            $json['groups'] = $this->groups;
        }
        if (null !== $this->dirty) {
            $json['dirty'] = $this->dirty;
        }
        if (null !== $this->deleted) {
            $json['deleted'] = $this->deleted;
        }
        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->functionalities && !empty($this->functionalities)) {
            $json['functionalities'] = $this->functionalities;
        }
        if (null !== $this->extraData && !empty($this->extraData)) {
            $json['extraData'] = $this->extraData;
        }
        if (null !== $this->userType) {
            $json['userType'] = $this->userType;
        }

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

        if (null !== $this->id) {
            $json['id'] = $this->id;
        }
        if (null !== $this->name) {
            $json['name'] = $this->name;
        }
        if (null !== $this->email) {
            $json['email'] = $this->email;
        }
        if (null !== $this->endDate) {
            $json['endDate'] = $this->endDate->format(\DateTime::ISO8601);
        }
        if (null !== $this->startDate) {
            $json['startDate'] = $this->startDate->format(\DateTime::ISO8601);
        }
        if (null !== $this->firstName) {
            $json['firstName'] = $this->firstName;
        }
        if (null !== $this->lastName) {
            $json['lastName'] = $this->lastName;
        }
        if (null !== $this->userName) {
            $json['userName'] = $this->userName;
        }
        if (null !== $this->lastLogin) {
            $json['lastLogin'] = $this->lastLogin->format(\DateTime::ISO8601);
        }
        if (null !== $this->groups && !empty($this->groups)) {
            $json['groups'] = $this->groups;
        }
        if (null !== $this->dirty) {
            $json['dirty'] = $this->dirty;
        }
        if (null !== $this->deleted) {
            $json['deleted'] = $this->deleted;
        }
        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->functionalities && !empty($this->functionalities)) {
            $json['functionalities'] = $this->functionalities;
        }
        if (null !== $this->extraData && !empty($this->extraData)) {
            $json['extraData'] = $this->extraData;
        }
        if (null !== $this->userType) {
            $json['userType'] = $this->userType;
        }

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

@return array an associative array of the available variables