Model/Room.php
public function toJson()
    {
        $json = array();

        $json['name'] = $this->getName();
        $json['privacy'] = $this->getPrivacy();
        //Parameters for PUT call (Room already exists)
        if ($this->getId()) {
            $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['guest_access'] = $this->isGuestAccessible();
            if ($this->getOwner()) {
                $json['owner_user_id'] = $this->getOwner()->getId();
            }
        }
        return $json;
    }
public function toJson()
    {
        $json = array();

        $json['name'] = $this->getName();
        $json['privacy'] = $this->getPrivacy();
        //Parameters for PUT call (Room already exists)
        if ($this->getId()) {
            $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['guest_access'] = $this->isGuestAccessible();
            if ($this->getOwner()) {
                $json['owner_user_id'] = $this->getOwner()->getId();
            }
        }
        return $json;
    }
public function toJson ( ) { $ json = array ( ) ; $ json [ 'name' ] = $ this -> getName ( ) ; $ json [ 'privacy' ] = $ this -> getPrivacy ( ) ; //Parameters for PUT call (Room already exists) if ( $ this -> getId ( ) ) { $ 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 [ 'guest_access' ] = $ this -> isGuestAccessible ( ) ; if ( $ this -> getOwner ( ) ) { $ json [ 'owner_user_id' ] = $ this -> getOwner ( ) -> getId ( ) ; } } return $ json ; }
Serializes Room object

@return array
Serializes Room object