'int', 'user_id'=>'int', 'guests'=>'int' ); public function __construct() { parent::__construct(); $users_list = array(); } // Getters // ======= public function getInvoiceId() { return $this->invoice_id; } public function get() { return $this->users_list; } // Setters // ======= public function setInvoiceId($id) { $this->invoice_id = (int) $id; } public function set($users_in) { $this->users_list = $users_in; } // Maps htmlspecialchars on the class before display // ================================================= public function secureDisplay() { $this->invoice_id = (int) $this->invoice_id; $temp_array = array(); foreach($this->users_list as $user=>$guests) { $temp_array[(int) $user] = (int) $guests; } $this->users_in = $temp_array; return $this; } // Restores object from array // ========================== public function sessionRestore($data, $serialized = false) { // TODO *** if($serialized) { $data = unserialize($data); } } }