48 unset($this->object_data_cache[$a_obj_id]);
59 return (
int) @$this->reference_cache[$a_ref_id];
68 return @$this->object_data_cache[$a_obj_id][
'title'];
78 return @$this->object_data_cache[$a_obj_id][
'type'];
87 return @$this->object_data_cache[$a_obj_id][
'owner'];
96 return @$this->object_data_cache[$a_obj_id][
'description'];
105 return @$this->object_data_cache[$a_obj_id][
'last_update'];
120 #static $not_cached = 0;
122 if(@$this->reference_cache[$a_ref_id])
124 #echo "Reference ". ++$cached ."cached<br>";
127 #echo "Reference ". ++$not_cached ." not cached<br>";
142 static $not_cached = 0;
145 if(@$this->object_data_cache[$a_obj_id])
147 #echo "Object ". ++$cached ."cached<br>";
150 #echo "Object ". ++$not_cached ." not cached<br>";
168 $query =
"SELECT obj_id FROM object_reference WHERE ref_id = ".$ilDB->quote($a_ref_id);
169 $res = $this->db->query($query);
172 $this->reference_cache[$a_ref_id] = $row[
'obj_id'];
174 return (
int) @$this->reference_cache[$a_ref_id];
186 global $ilDB, $objDefinition, $ilUser;
188 if (is_object($ilUser) && $a_lang ==
"")
190 $a_lang = $ilUser->getLanguage();
193 $query =
"SELECT * FROM object_data WHERE obj_id = ".
194 $ilDB->quote($a_obj_id);
195 $res = $this->db->query($query);
198 $this->object_data_cache[$a_obj_id][
'title'] = $row->title;
199 $this->object_data_cache[$a_obj_id][
'description'] = $row->description;
200 $this->object_data_cache[$a_obj_id][
'type'] = $row->type;
201 $this->object_data_cache[$a_obj_id][
'owner'] = $row->owner;
202 $this->object_data_cache[$a_obj_id][
'last_update'] = $row->last_update;
205 if (is_object($objDefinition))
207 $translation_type = $objDefinition->getTranslationType($row->type);
211 if ($translation_type ==
"db")
214 $q =
"SELECT title,description FROM object_translation ".
215 "WHERE obj_id = ".$ilDB->quote($a_obj_id).
" ".
216 "AND lang_code = ".$ilDB->quote($a_lang).
" ".
217 "AND NOT lang_default = 1";
218 $r = $ilDB->query($q);
223 $this->object_data_cache[$a_obj_id][
'title'] = $row->title;
224 $this->object_data_cache[$a_obj_id][
'description'] = $row->description;
242 global $ilDB, $objDefinition, $ilUser;
244 if (is_object($ilUser) && $a_lang ==
"")
246 $a_lang = $ilUser->getLanguage();
250 if (!is_array($a_obj_ids))
return;
251 if (count($a_obj_ids) == 0)
return;
253 $query =
"SELECT * FROM object_data WHERE obj_id IN (".
255 $res = $ilDB->query($query);
259 $this->object_data_cache[$row->obj_id][
'title'] = $row->title;
260 $this->object_data_cache[$row->obj_id][
'description'] = $row->description;
261 $this->object_data_cache[$row->obj_id][
'type'] = $row->type;
262 $this->object_data_cache[$row->obj_id][
'owner'] = $row->owner;
263 $this->object_data_cache[$row->obj_id][
'last_update'] = $row->last_update;
265 if (is_object($objDefinition))
267 $translation_type = $objDefinition->getTranslationType($row->type);
271 if ($translation_type ==
"db")
274 $q =
"SELECT title,description FROM object_translation ".
275 "WHERE obj_id = ".$ilDB->quote($row->obj_id).
" ".
276 "AND lang_code = ".$ilDB->quote($a_lang).
" ".
277 "AND NOT lang_default = 1";
278 $r = $ilDB->query($q);
283 $this->object_data_cache[$row->obj_id][
'title'] = $row2->title;
284 $this->object_data_cache[$row->obj_id][
'description'] = $row2->description;
295 if (!is_array($a_ref_ids))
return;
296 if (count($a_ref_ids) == 0)
return;
298 $query =
"SELECT ref_id, obj_id FROM object_reference WHERE ref_id IN (".
300 $res = $this->db->query($query);
304 $this->reference_cache[$row[
'ref_id']] = $row[
'obj_id'];
306 $obj_ids[] = $row[
'obj_id'];