id = $id*1; } public function fetch_data() { if (!$this->id) { return false; } $query = 'select explnum_licence_right_explnum_licence_num, explnum_licence_right_label, explnum_licence_right_logo_url, explnum_licence_right_explanation, explnum_licence_right_type from explnum_licence_rights where id_explnum_licence_right = '.$this->id; $result = pmb_mysql_query($query); $row = pmb_mysql_fetch_assoc($result); if (count($row)) { $this->explnum_licence_num = $row['explnum_licence_right_explnum_licence_num']; $this->label = translation::get_text($this->id, 'explnum_licence_rights', 'explnum_licence_right_label', $row['explnum_licence_right_label']); $this->logo_url = translation::get_text($this->id, 'explnum_licence_rights', 'explnum_licence_right_logo_url', $row['explnum_licence_right_logo_url']); $this->explanation = translation::get_text($this->id, 'explnum_licence_rights', 'explnum_licence_right_explanation', $row['explnum_licence_right_explanation']); $this->type = $row['explnum_licence_right_type']; } } public function set_explnum_licence_num($explnum_licence_num) { $this->explnum_licence_num = $explnum_licence_num*1; return $this; } public function get_label(){ if(!isset($this->label)){ $this->fetch_data(); } return $this->label; } public function get_id(){ return $this->id; } public function get_logo_url() { if (!isset($this->logo_url)) { $this->fetch_data(); } return $this->logo_url; } public function get_explanation() { if (!isset($this->explanation)) { $this->fetch_data(); } return $this->explanation; } public function get_type() { if (!isset($this->type)) { $this->fetch_data(); } return $this->type; } }