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();
173 $query =
"SELECT * FROM object_data WHERE obj_id = ".
174 $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;
185 if (is_object($objDefinition))
187 $translation_type = $objDefinition->getTranslationType(
$row->type);
191 if ($translation_type ==
"db")
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;
222 global
$ilDB, $objDefinition, $ilUser;
224 if (is_object($ilUser) && $a_lang ==
"")
226 $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');
240 $this->object_data_cache[
$row->obj_id][
'title'] =
$row->title;
241 $this->object_data_cache[
$row->obj_id][
'description'] =
$row->description;
242 $this->object_data_cache[
$row->obj_id][
'type'] =
$row->type;
243 $this->object_data_cache[
$row->obj_id][
'owner'] =
$row->owner;
244 $this->object_data_cache[
$row->obj_id][
'last_update'] =
$row->last_update;
246 if (is_object($objDefinition))
248 $translation_type = $objDefinition->getTranslationType(
$row->type);
252 if ($translation_type ==
"db")
255 $q =
"SELECT title,description FROM object_translation ".
256 "WHERE obj_id = ".$ilDB->quote(
$row->obj_id,
'integer').
" ".
257 "AND lang_code = ".$ilDB->quote($a_lang,
'text').
" ".
258 "AND NOT lang_default = 1";
259 $r = $ilDB->query(
$q);
264 $this->object_data_cache[
$row->obj_id][
'title'] = $row2->title;
265 $this->object_data_cache[
$row->obj_id][
'description'] = $row2->description;
276 if (!is_array($a_ref_ids))
return;
277 if (count($a_ref_ids) == 0)
return;
279 $query =
"SELECT ref_id, obj_id FROM object_reference ".
280 "WHERE ".$ilDB->in(
'ref_id',$a_ref_ids,
false,
'integer');
286 $this->reference_cache[
$row[
'ref_id']] = $row[
'obj_id'];
288 $obj_ids[] = $row[
'obj_id'];