fetch_datas(); } // end of member function __construct protected function fetch_datas(){ global $dbh; $this->formations =array(); $query = "select id_formation from nomenclature_formations order by formation_order"; $result = pmb_mysql_query($query,$dbh); if(pmb_mysql_num_rows($result)){ while($row = pmb_mysql_fetch_object($result)){ $this->add_formation( new nomenclature_formation($row->id_formation)); } } } public function add_formation($formation ) { // $formation->set_formation($this); $this->formations[] = $formation; } // end of member function add_formation public function get_data() { $data=array(); foreach($this->formations as $formation){ $data[]=$formation->get_data(); } return($data); } public function get_json_informations(){ $data = json_encode($this->get_data()); return $data; } } // end of nomenclature_formations