diff --git a/Model/Room.php b/Model/Room.php index 297171b..8b290e8 100644 --- a/Model/Room.php +++ b/Model/Room.php @@ -93,8 +93,8 @@ public function toJson() $json['is_archived'] = $this->isArchived(); $json['is_guest_accessible'] = $this->isGuestAccessible(); $json['topic'] = $this->getTopic(); - $json['owner'] = array('id' => $this->getOwner()->getId()); - } else { //Paramters for POST call + $json['owner'] = is_null($this->getOwner()) ? null : $this->getOwner()->toJson(); + } else { //Parameters for POST call $json['guest_access'] = $this->isGuestAccessible(); if ($this->getOwner()) { $json['owner_user_id'] = $this->getOwner()->getId(); diff --git a/Model/User.php b/Model/User.php index 7d3d6cb..9657b3a 100644 --- a/Model/User.php +++ b/Model/User.php @@ -83,6 +83,7 @@ public function parseJson($json) public function toJson() { $json = array(); + $json['id'] = $this->id; $json['name'] = $this->name; $json['title'] = $this->title; $json['mention_name'] = $this->mentionName;