50 if(isset(self::$cached_values[$a_obj_id]))
52 return self::$cached_values[$a_obj_id];
54 $query =
"SELECT field_id,value FROM adv_md_values ".
55 "WHERE obj_id = ".$ilDB->quote($a_obj_id);
56 $res = $ilDB->query($query);
58 self::$cached_values[$a_obj_id] = array();
61 self::$cached_values[$a_obj_id][$row->field_id] = $row->value;
63 return self::$cached_values[$a_obj_id];
79 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
80 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
85 $ilLog->write(__METHOD__.
': No advanced meta data found.');
89 $ilLog->write(__METHOD__.
': Start cloning advanced meta data.');
91 foreach(self::_getValuesByObjId($a_source_id) as $field_id => $value)
93 if(!in_array($field_id,$defs))
98 $new_value->setValue($value);
120 $query =
"SELECT field_id FROM adv_md_record AS amr ".
121 "JOIN adv_md_record_objs AS amro ON amr.record_id = amro.record_id ".
122 "JOIN adv_md_field_definition AS amfd ON amr.record_id = amfd.record_id ".
124 "AND obj_type = ".$ilDB->quote($type).
" ";
128 $res = $ilDB->query($query);
131 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
133 $value->appendXML($xml_writer);
135 $xml_writer->
xmlEndTag(
'AdvancedMetaData');
150 $query =
"SELECT obj_id,field_id,value FROM adv_md_values ".
151 "WHERE obj_id IN (".implode(
"','",$obj_ids).
")";
152 $res = $ilDB->query($query);
155 self::$cached_values[$row->obj_id][$row->field_id] = $row->value;
173 $query =
"DELETE FROM adv_md_values ".
174 "WHERE field_id = ".$ilDB->quote($a_field_id).
" ";
175 $ilDB->query($query);
190 $query =
"DELETE FROM adv_md_values ".
191 "WHERE obj_id = ".$ilDB->quote($a_obj_id).
" ";
192 $ilDB->query($query);