fetch_datas(); } // end of member function __construct protected function fetch_datas(){ global $dbh; $this->instruments =array(); $query = "select id_instrument from nomenclature_instruments order by instrument_name"; $result = pmb_mysql_query($query,$dbh); if(pmb_mysql_num_rows($result)){ while($row = pmb_mysql_fetch_object($result)){ $this->add_instrument( new nomenclature_instrument($row->id_instrument)); } } } public function add_instrument($instrument ) { $this->instruments[] = $instrument; } // end of member function add_instrument public function get_data($duplicate = false) { $data=array(); foreach($this->instruments as $instrument){ $data[]=$instrument->get_data($duplicate); } return($data); } public function get_json_informations(){ $data = json_encode(encoding_normalize::utf8_normalize($this->get_data())); return $data; } } // end of nomenclature_instruments