24 $ilDB = $DIC->database();
31 unset($this->object_data_cache[$a_obj_id]);
41 return (
int) @$this->reference_cache[$a_ref_id];
49 return @$this->object_data_cache[$a_obj_id][
'title'];
58 return @$this->object_data_cache[$a_obj_id][
'type'];
66 return @$this->object_data_cache[$a_obj_id][
'owner'];
74 return @$this->object_data_cache[$a_obj_id][
'description'];
82 return @$this->object_data_cache[$a_obj_id][
'last_update'];
97 #static $not_cached = 0; 99 if (@$this->reference_cache[$a_ref_id]) {
100 #echo "Reference ". ++$cached ."cached<br>"; 103 #echo "Reference ". ++$not_cached ." not cached<br>"; 117 static $not_cached = 0;
120 if (@$this->object_data_cache[$a_obj_id]) {
121 #echo "Object ". ++$cached ."cached<br>"; 124 #echo "Object ". ++$not_cached ." not cached<br>"; 142 $query =
"SELECT obj_id FROM object_reference WHERE ref_id = " .
$ilDB->quote($a_ref_id,
'integer');
145 $this->reference_cache[$a_ref_id] =
$row[
'obj_id'];
147 return (
int) @$this->reference_cache[$a_ref_id];
162 $objDefinition = $DIC[
"objDefinition"];
165 if (is_object(
$ilUser) && $a_lang ==
"") {
166 $a_lang =
$ilUser->getLanguage();
169 $query =
"SELECT * FROM object_data WHERE obj_id = " .
170 $ilDB->quote($a_obj_id,
'integer');
173 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
174 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
175 $this->object_data_cache[$a_obj_id][
'type'] =
$row->type;
176 $this->object_data_cache[$a_obj_id][
'owner'] =
$row->owner;
177 $this->object_data_cache[$a_obj_id][
'last_update'] =
$row->last_update;
179 if (is_object($objDefinition)) {
180 $translation_type = $objDefinition->getTranslationType(
$row->type);
183 if ($translation_type ==
"db") {
184 if (!$this->trans_loaded[$a_obj_id]) {
185 $q =
"SELECT title,description FROM object_translation " .
186 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
187 "AND lang_code = " .
$ilDB->quote($a_lang,
'text') .
" " .
188 "AND NOT lang_default = 1";
193 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
194 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
195 $this->description_trans[] = $a_obj_id;
197 $this->trans_loaded[$a_obj_id] =
true;
207 return (is_array($this->description_trans) &&
208 in_array($a_obj_id, $this->description_trans));
223 $objDefinition = $DIC[
"objDefinition"];
226 if (is_object(
$ilUser) && $a_lang ==
"") {
227 $a_lang =
$ilUser->getLanguage();
230 if (!is_array($a_obj_ids)) {
233 if (count($a_obj_ids) == 0) {
238 $query =
"SELECT * FROM object_data " .
239 "WHERE " .
$ilDB->in(
'obj_id', $a_obj_ids,
false,
'integer');
246 if (!$this->trans_loaded[
$row->obj_id]) {
247 $this->object_data_cache[
$row->obj_id][
'title'] =
$row->title;
248 $this->object_data_cache[
$row->obj_id][
'description'] =
$row->description;
250 $this->object_data_cache[
$row->obj_id][
'type'] =
$row->type;
251 $this->object_data_cache[
$row->obj_id][
'owner'] =
$row->owner;
252 $this->object_data_cache[
$row->obj_id][
'last_update'] =
$row->last_update;
254 if (is_object($objDefinition)) {
255 $translation_type = $objDefinition->getTranslationType(
$row->type);
258 if ($translation_type ==
"db") {
259 $db_trans[
$row->obj_id] =
$row->obj_id;
262 if (count($db_trans) > 0) {
277 foreach ($a_obj_ids as
$id) {
279 if (!$this->trans_loaded[$id]) {
281 $this->trans_loaded[
$id] =
true;
284 if (count($obj_ids) > 0) {
285 $q =
"SELECT obj_id, title, description FROM object_translation " .
286 "WHERE " .
$ilDB->in(
'obj_id', $obj_ids,
false,
'integer') .
" " .
287 "AND lang_code = " .
$ilDB->quote($a_lang,
'text') .
" " .
288 "AND NOT lang_default = 1";
291 $this->object_data_cache[$row2->obj_id][
'title'] = $row2->title;
292 $this->object_data_cache[$row2->obj_id][
'description'] = $row2->description;
293 $this->description_trans[] = $row2->obj_id;
302 if (!is_array($a_ref_ids)) {
305 if (count($a_ref_ids) == 0) {
309 $query =
"SELECT ref_id, obj_id FROM object_reference " .
310 "WHERE " .
$ilDB->in(
'ref_id', $a_ref_ids,
false,
'integer');
315 $this->reference_cache[
$row[
'ref_id']] = $row[
'obj_id'];
317 $obj_ids[] = $row[
'obj_id'];
__isObjectCached($a_obj_id)
checks whether an object is aleady in cache or not
__isReferenceCached($a_ref_id)
checks whether an reference id is already in cache or not
preloadTranslations($a_obj_ids, $a_lang)
Preload translation informations.
lookupDescription($a_obj_id)
lookupLastUpdate($a_obj_id)
preloadObjectCache($a_obj_ids, $a_lang="")
Stores object data in cache.
__storeObjectData($a_obj_id, $a_lang="")
Stores object data in cache.
if(!array_key_exists('StateId', $_REQUEST)) $id
deleteCachedEntry($a_obj_id)
__storeReference($a_ref_id)
Stores Reference in cache.
foreach($_POST as $key=> $value) $res
preloadReferenceCache($a_ref_ids, $a_incl_obj=true)
Create styles array
The data for the language used.
isTranslatedDescription($a_obj_id)