28 unset($this->object_data_cache[$a_obj_id]);
39 return (
int) @$this->reference_cache[$a_ref_id];
48 return @$this->object_data_cache[$a_obj_id][
'title'];
58 return @$this->object_data_cache[$a_obj_id][
'type'];
67 return @$this->object_data_cache[$a_obj_id][
'owner'];
76 return @$this->object_data_cache[$a_obj_id][
'description'];
85 return @$this->object_data_cache[$a_obj_id][
'last_update'];
100 #static $not_cached = 0;
102 if(@$this->reference_cache[$a_ref_id])
104 #echo "Reference ". ++$cached ."cached<br>";
107 #echo "Reference ". ++$not_cached ." not cached<br>";
122 static $not_cached = 0;
125 if(@$this->object_data_cache[$a_obj_id])
127 #echo "Object ". ++$cached ."cached<br>";
130 #echo "Object ". ++$not_cached ." not cached<br>";
148 $query =
"SELECT obj_id FROM object_reference WHERE ref_id = ".$ilDB->quote($a_ref_id,
'integer');
152 $this->reference_cache[$a_ref_id] =
$row[
'obj_id'];
154 return (
int) @$this->reference_cache[$a_ref_id];
166 global
$ilDB, $objDefinition, $ilUser;
168 if (is_object($ilUser) && $a_lang ==
"")
170 $a_lang = $ilUser->getLanguage();
172 $query =
"SELECT * FROM object_data WHERE obj_id = ".
173 $ilDB->quote($a_obj_id ,
'integer');
178 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
179 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
180 $this->object_data_cache[$a_obj_id][
'type'] =
$row->type;
181 $this->object_data_cache[$a_obj_id][
'owner'] =
$row->owner;
182 $this->object_data_cache[$a_obj_id][
'last_update'] =
$row->last_update;
184 if (is_object($objDefinition))
186 $translation_type = $objDefinition->getTranslationType(
$row->type);
189 if ($translation_type ==
"db")
191 if (!$this->trans_loaded[$a_obj_id])
193 $q =
"SELECT title,description FROM object_translation ".
194 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ".
195 "AND lang_code = ".$ilDB->quote($a_lang,
'text').
" ".
196 "AND NOT lang_default = 1";
197 $r = $ilDB->query($q);
202 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
203 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
205 $this->trans_loaded[$a_obj_id] =
true;
223 global
$ilDB, $objDefinition, $ilUser, $tree;
225 if (is_object($ilUser) && $a_lang ==
"")
227 $a_lang = $ilUser->getLanguage();
230 if (!is_array($a_obj_ids))
return;
231 if (count($a_obj_ids) == 0)
return;
234 $query =
"SELECT * FROM object_data ".
235 "WHERE ".$ilDB->in(
'obj_id',$a_obj_ids,
false,
'integer');
243 if (!$this->trans_loaded[
$row->obj_id])
245 $this->object_data_cache[
$row->obj_id][
'title'] =
$row->title;
246 $this->object_data_cache[
$row->obj_id][
'description'] =
$row->description;
248 $this->object_data_cache[
$row->obj_id][
'type'] =
$row->type;
249 $this->object_data_cache[
$row->obj_id][
'owner'] =
$row->owner;
250 $this->object_data_cache[
$row->obj_id][
'last_update'] =
$row->last_update;
252 if (is_object($objDefinition))
254 $translation_type = $objDefinition->getTranslationType(
$row->type);
257 if ($translation_type ==
"db")
259 $db_trans[
$row->obj_id] =
$row->obj_id;
262 if (count($db_trans) > 0)
278 foreach ($a_obj_ids as $id)
281 if (!$this->trans_loaded[$id])
284 $this->trans_loaded[$id] =
true;
287 if (count($obj_ids) > 0)
289 $q =
"SELECT obj_id, title, description FROM object_translation ".
290 "WHERE ".$ilDB->in(
'obj_id', $obj_ids,
false,
'integer').
" ".
291 "AND lang_code = ".$ilDB->quote($a_lang,
'text').
" ".
292 "AND NOT lang_default = 1";
293 $r = $ilDB->query($q);
296 $this->object_data_cache[$row2->obj_id][
'title'] = $row2->title;
297 $this->object_data_cache[$row2->obj_id][
'description'] = $row2->description;
306 if (!is_array($a_ref_ids))
return;
307 if (count($a_ref_ids) == 0)
return;
309 $query =
"SELECT ref_id, obj_id FROM object_reference ".
310 "WHERE ".$ilDB->in(
'ref_id',$a_ref_ids,
false,
'integer');
316 $this->reference_cache[
$row[
'ref_id']] = $row[
'obj_id'];
318 $obj_ids[] = $row[
'obj_id'];