--- /dev/null
+<?php
+
+ require_once('protected/required.php');
+
+ class Instance {
+
+ protected $id, $nom, $exploitant, $reference, $version, $historique, $maintenu;
+
+ /// CONSTRUCTEUR
+ function __construct($id = null, $nom = null, $exploitant = null, $reference = null, $version = null, $historique = null, $maintenu = null) {
+
+ $this -> id = $id;
+ $this -> nom = $nom;
+ // Référence client de l'exploitant
+ $this -> exploitant = $exploitant;
+ // Référence / identifiant du instance
+ $this -> reference = $reference;
+ // Version actuelle
+ $this -> version = $version;
+ // Id de l'historique de màj / patchs
+ $this -> historique = $historique;
+ // Pseudo-booleen : vaut 1 si le instance est encore maintenu, 0 sinon
+ $this -> maintenu = $maintenu;
+
+ // TO-DO : AJOUT DE :
+ /*
+ - fqdnInterne
+ - fqdnExterne
+ - systeme
+ - uid
+ */
+ }
+
+ public function getJSON() {
+ return json_encode(get_object_vars($this));
+ }
+
+ public function getJSONP() {
+ $array["id"] = $this -> id;
+ $array["nom"] = $this -> nom;
+ $array["exploitant"] = $this -> exploitant;
+ $array["reference"] = $this -> reference;
+ $array["version"] = $this -> version;
+ $array["historique"] = $this -> historique;
+ $array["maintenu"] = $this -> maintenu;
+
+ return json_encode($array);
+ }
+
+ /// GETTERS
+ public function getId() { return $this -> id; }
+ public function getNom() { return $this->nom; }
+ public function getExploitant() { return $this->exploitant; }
+ public function getReference() { return $this->reference; }
+ public function getVersion() { return $this->version; }
+ public function getHistorique() { return $this->historique; }
+ public function estMaintenu() { return $this->maintenu; }
+
+ /// SETTERS
+ public function setId($id) { $this -> id = $id; }
+ public function setNom($nom) { $this->nom = $nom; }
+ public function setExploitant($exploitant) { $this->exploitant = $exploitant; }
+ public function setReference($reference) { $this->reference = $reference; }
+ public function setVersion($version) { $this->version = $version; }
+ public function setHistorique($historique) { $this->historique = $historique; }
+ public function setMaintenu($maintenu) { $this->maintenu = $maintenu; }
+
+ }
+
+?>
\ No newline at end of file