--- /dev/null
+<?php
+
+ require_once('protected/required.php');
+
+ class Contract {
+
+ protected $id, $number, $state, $appliances;
+
+ /// CONSTRUCTOR
+ function __construct($id = null, $number = null, $state = null, $appliances = null) {
+
+ $this -> id = $id;
+ $this -> number = $number;
+ $this -> state = $state;
+ $this -> appliances = $appliances;
+
+ }
+
+ public function getJSON() {
+ return json_encode(get_object_vars($this));
+ }
+
+ public function getJSONP() {
+ $array["id"] = $this -> id;
+ $array["number"] = $this -> number;
+ $array["state"] = $this -> state;
+ $array["appliances"] = $this -> appliances;
+
+ return json_encode($array);
+ }
+
+ /// GETTERS
+ public function getId() { return $this -> id; }
+ public function getNumber() { return $this->number; }
+ public function getState() { return $this->state; }
+ public function getAppliances() { return $this->appliances; }
+
+ /// SETTERS
+ public function setId($id) { $this -> id = $id; }
+ public function setNumber($number) { $this->number = $number; }
+ public function setState($state) { $this->state = $state; }
+ public function setAppliances($appliances) { $this->appliances = $appliances; }
+
+ }