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'];
95 return (
bool) $this->object_data_cache[$a_obj_id][
'offline'];
111 #static $not_cached = 0; 113 if (@$this->reference_cache[$a_ref_id]) {
114 #echo "Reference ". ++$cached ."cached<br>"; 117 #echo "Reference ". ++$not_cached ." not cached<br>"; 131 static $not_cached = 0;
134 if (@$this->object_data_cache[$a_obj_id]) {
135 #echo "Object ". ++$cached ."cached<br>"; 138 #echo "Object ". ++$not_cached ." not cached<br>"; 156 $query =
"SELECT obj_id FROM object_reference WHERE ref_id = " .
$ilDB->quote($a_ref_id,
'integer');
159 $this->reference_cache[$a_ref_id] =
$row[
'obj_id'];
161 return (
int) @$this->reference_cache[$a_ref_id];
176 $objDefinition = $DIC[
"objDefinition"];
179 if (is_object(
$ilUser) && $a_lang ==
"") {
180 $a_lang =
$ilUser->getLanguage();
183 $query =
"SELECT * FROM object_data WHERE obj_id = " .
184 $ilDB->quote($a_obj_id,
'integer');
187 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
188 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
189 $this->object_data_cache[$a_obj_id][
'type'] =
$row->type;
190 $this->object_data_cache[$a_obj_id][
'owner'] =
$row->owner;
191 $this->object_data_cache[$a_obj_id][
'last_update'] =
$row->last_update;
192 $this->object_data_cache[$a_obj_id][
'offline'] =
$row->offline;
194 if (is_object($objDefinition)) {
195 $translation_type = $objDefinition->getTranslationType(
$row->type);
198 if ($translation_type ==
"db") {
199 if (!$this->trans_loaded[$a_obj_id]) {
200 $q =
"SELECT title,description FROM object_translation " .
201 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
202 "AND lang_code = " .
$ilDB->quote($a_lang,
'text') .
" " .
203 "AND NOT lang_default = 1";
208 $this->object_data_cache[$a_obj_id][
'title'] =
$row->title;
209 $this->object_data_cache[$a_obj_id][
'description'] =
$row->description;
210 $this->description_trans[] = $a_obj_id;
212 $this->trans_loaded[$a_obj_id] =
true;
222 return (is_array($this->description_trans) &&
223 in_array($a_obj_id, $this->description_trans));
238 $objDefinition = $DIC[
"objDefinition"];
241 if (is_object(
$ilUser) && $a_lang ==
"") {
242 $a_lang =
$ilUser->getLanguage();
244 if (!is_array($a_obj_ids)) {
247 if (count($a_obj_ids) == 0) {
252 $query =
"SELECT * FROM object_data " .
253 "WHERE " .
$ilDB->in(
'obj_id', $a_obj_ids,
false,
'integer');
259 if (!$this->trans_loaded[
$row->obj_id]) {
260 $this->object_data_cache[
$row->obj_id][
'title'] =
$row->title;
261 $this->object_data_cache[
$row->obj_id][
'description'] =
$row->description;
263 $this->object_data_cache[
$row->obj_id][
'type'] =
$row->type;
264 $this->object_data_cache[
$row->obj_id][
'owner'] =
$row->owner;
265 $this->object_data_cache[
$row->obj_id][
'last_update'] =
$row->last_update;
266 $this->object_data_cache[
$row->obj_id][
'offline'] =
$row->offline;
268 if (is_object($objDefinition)) {
269 $translation_type = $objDefinition->getTranslationType(
$row->type);
272 if ($translation_type ==
"db") {
273 $db_trans[
$row->obj_id] =
$row->obj_id;
276 if (count($db_trans) > 0) {
291 foreach ($a_obj_ids as
$id) {
293 if (!$this->trans_loaded[$id]) {
295 $this->trans_loaded[
$id] =
true;
298 if (count($obj_ids) > 0) {
299 $q =
"SELECT obj_id, title, description FROM object_translation " .
300 "WHERE " .
$ilDB->in(
'obj_id', $obj_ids,
false,
'integer') .
" " .
301 "AND lang_code = " .
$ilDB->quote($a_lang,
'text') .
" " .
302 "AND NOT lang_default = 1";
305 $this->object_data_cache[$row2->obj_id][
'title'] = $row2->title;
306 $this->object_data_cache[$row2->obj_id][
'description'] = $row2->description;
307 $this->description_trans[] = $row2->obj_id;
316 if (!is_array($a_ref_ids)) {
319 if (count($a_ref_ids) == 0) {
323 $query =
"SELECT ref_id, obj_id FROM object_reference " .
324 "WHERE " .
$ilDB->in(
'ref_id', $a_ref_ids,
false,
'integer');
329 $this->reference_cache[
$row[
'ref_id']] = $row[
'obj_id'];
331 $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)
lookupOfflineStatus($a_obj_id)
Check if supports centralized offline handling and is offline.
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)
isTranslatedDescription($a_obj_id)