58 $this->obj_id = $a_obj_id;
59 $this->field_id = $a_field_id;
74 if(isset(self::$instances[$a_obj_id][$a_field_id]))
76 return self::$instances[$a_obj_id][$a_field_id];
78 return self::$instances[$a_obj_id][$a_field_id] =
new ilAdvancedMDValue($a_field_id,$a_obj_id);
101 $this->obj_id = $a_obj_id;
113 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
115 $xml_writer->xmlElement(
'Value',
130 $this->value = $a_value;
165 $this->disabled = (bool) $a_status;
174 public function delete()
176 $query =
"DELETE FROM adv_md_values ".
177 "WHERE obj_id = ".$this->db->quote($this->obj_id).
" ".
178 "AND field_id = ".$this->db->quote($this->field_id);
179 $res = $this->db->query($query);
190 $query =
"REPLACE INTO adv_md_values ".
191 "SET obj_id = ".$this->db->quote($this->obj_id).
", ".
192 "field_id = ".$this->db->quote($this->field_id).
", ".
193 "value = ".$this->db->quote($this->
getValue()).
", ".
195 $res = $this->db->query($query);
205 if(!$this->obj_id or !$this->field_id)
210 $query =
"SELECT * FROM adv_md_values ".
211 "WHERE obj_id = ".$this->db->quote($this->obj_id).
" ".
212 "AND field_id = ".$this->db->quote($this->field_id).
" ";
213 $res = $this->db->query($query);