Model/Room.php
public function parseJson($json)
    {
        $this->id = $json['id'];
        $this->name = $json['name'];
        $this->links = $json['links'];

        if (isset($json['xmpp_jid'])) {
            $this->xmppJid = $json['xmpp_jid'];
            //Statistics need to be implemented
            $this->created = new \DateTime($json['created']);
            $this->archived = $json['is_archived'];
            $this->privacy = $json['privacy'];
            $this->guestAccessible = $json['is_guest_accessible'];
            $this->topic = $json['topic'];
            $this->participants = array();
            foreach ($json['participants'] as $participant) {
                $this->participants[] = new User($participant);
            }
            $this->owner = new User($json['owner']);
            $this->guestAccessUrl = $json['guest_access_url'];
        }
    }
public function parseJson($json)
    {
        $this->id = $json['id'];
        $this->name = $json['name'];
        $this->links = $json['links'];

        if (isset($json['xmpp_jid'])) {
            $this->xmppJid = $json['xmpp_jid'];
            //Statistics need to be implemented
            $this->created = new \DateTime($json['created']);
            $this->archived = $json['is_archived'];
            $this->privacy = $json['privacy'];
            $this->guestAccessible = $json['is_guest_accessible'];
            $this->topic = $json['topic'];
            $this->participants = array();
            foreach ($json['participants'] as $participant) {
                $this->participants[] = new User($participant);
            }
            $this->owner = new User($json['owner']);
            $this->guestAccessUrl = $json['guest_access_url'];
        }
    }
public function parseJson ( $ json ) { $ this -> id = $ json [ 'id' ] ; $ this -> name = $ json [ 'name' ] ; $ this -> links = $ json [ 'links' ] ; if ( isset ( $ json [ 'xmpp_jid' ] ) ) { $ this -> xmppJid = $ json [ 'xmpp_jid' ] ; //Statistics need to be implemented $ this -> created = new \ DateTime ( $ json [ 'created' ] ) ; $ this -> archived = $ json [ 'is_archived' ] ; $ this -> privacy = $ json [ 'privacy' ] ; $ this -> guestAccessible = $ json [ 'is_guest_accessible' ] ; $ this -> topic = $ json [ 'topic' ] ; $ this -> participants = array ( ) ; foreach ( $ json [ 'participants' ] as $ participant ) { $ this -> participants [ ] = new User ( $ participant ) ; } $ this -> owner = new User ( $ json [ 'owner' ] ) ; $ this -> guestAccessUrl = $ json [ 'guest_access_url' ] ; } }
Parses response given by the API and maps the fields to Room object

@param array $json json_decoded response in json given by the server

@return void
Parses response given by the API and maps the fields to Room object