29 unset($this->object_data_cache[$a_obj_id]);
40 return (
int) @$this->reference_cache[$a_ref_id];
49 return @$this->object_data_cache[$a_obj_id][
'title'];
59 return @$this->object_data_cache[$a_obj_id][
'type'];
68 return @$this->object_data_cache[$a_obj_id][
'owner'];
77 return @$this->object_data_cache[$a_obj_id][
'description'];
86 return @$this->object_data_cache[$a_obj_id][
'last_update'];
101 #static $not_cached = 0;
103 if(@$this->reference_cache[$a_ref_id])
105 #echo "Reference ". ++$cached ."cached<br>";
108 #echo "Reference ". ++$not_cached ." not cached<br>";
123 static $not_cached = 0;
126 if(@$this->object_data_cache[$a_obj_id])
128 #echo "Object ". ++$cached ."cached<br>";
131 #echo "Object ". ++$not_cached ." not cached<br>";
149 $query =
"SELECT obj_id FROM object_reference WHERE ref_id = ".$ilDB->quote($a_ref_id,
'integer');
153 $this->reference_cache[$a_ref_id] =
$row[
'obj_id'];
155 return (
int) @$this->reference_cache[$a_ref_id];
167 global $ilDB, $objDefinition,
$ilUser;
169 if (is_object($ilUser) && $a_lang ==
"")
171 $a_lang = $ilUser->getLanguage();
174 $query =
"SELECT * FROM object_data WHERE obj_id = ".
175 $ilDB->quote($a_obj_id ,
'integer');
179 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
180 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
181 $this->object_data_cache[$a_obj_id][
'type'] =
$row->type;
182 $this->object_data_cache[$a_obj_id][
'owner'] =
$row->owner;
183 $this->object_data_cache[$a_obj_id][
'last_update'] =
$row->last_update;
185 if (is_object($objDefinition))
187 $translation_type = $objDefinition->getTranslationType(
$row->type);
190 if ($translation_type ==
"db")
192 if (!$this->trans_loaded[$a_obj_id])
194 $q =
"SELECT title,description FROM object_translation ".
195 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ".
196 "AND lang_code = ".$ilDB->quote($a_lang,
'text').
" ".
197 "AND NOT lang_default = 1";
198 $r = $ilDB->query($q);
203 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
204 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
205 $this->description_trans[] = $a_obj_id;
207 $this->trans_loaded[$a_obj_id] =
true;
217 return (is_array($this->description_trans) &&
218 in_array($a_obj_id, $this->description_trans));
230 global $ilDB, $objDefinition,
$ilUser, $tree;
232 if (is_object($ilUser) && $a_lang ==
"")
234 $a_lang = $ilUser->getLanguage();
237 if (!is_array($a_obj_ids))
return;
238 if (count($a_obj_ids) == 0)
return;
241 $query =
"SELECT * FROM object_data ".
242 "WHERE ".$ilDB->in(
'obj_id',$a_obj_ids,
false,
'integer');
250 if (!$this->trans_loaded[
$row->obj_id])
252 $this->object_data_cache[
$row->obj_id][
'title'] =
$row->title;
253 $this->object_data_cache[
$row->obj_id][
'description'] =
$row->description;
255 $this->object_data_cache[
$row->obj_id][
'type'] =
$row->type;
256 $this->object_data_cache[
$row->obj_id][
'owner'] =
$row->owner;
257 $this->object_data_cache[
$row->obj_id][
'last_update'] =
$row->last_update;
259 if (is_object($objDefinition))
261 $translation_type = $objDefinition->getTranslationType(
$row->type);
264 if ($translation_type ==
"db")
266 $db_trans[
$row->obj_id] =
$row->obj_id;
269 if (count($db_trans) > 0)
285 foreach ($a_obj_ids as $id)
288 if (!$this->trans_loaded[$id])
291 $this->trans_loaded[$id] =
true;
294 if (count($obj_ids) > 0)
296 $q =
"SELECT obj_id, title, description FROM object_translation ".
297 "WHERE ".$ilDB->in(
'obj_id', $obj_ids,
false,
'integer').
" ".
298 "AND lang_code = ".$ilDB->quote($a_lang,
'text').
" ".
299 "AND NOT lang_default = 1";
300 $r = $ilDB->query($q);
303 $this->object_data_cache[$row2->obj_id][
'title'] = $row2->title;
304 $this->object_data_cache[$row2->obj_id][
'description'] = $row2->description;
305 $this->description_trans[] = $row2->obj_id;
314 if (!is_array($a_ref_ids))
return;
315 if (count($a_ref_ids) == 0)
return;
317 $query =
"SELECT ref_id, obj_id FROM object_reference ".
318 "WHERE ".$ilDB->in(
'ref_id',$a_ref_ids,
false,
'integer');
324 $this->reference_cache[
$row[
'ref_id']] = $row[
'obj_id'];
326 $obj_ids[] = $row[
'obj_id'];