3 declare(strict_types=1);
    42         $this->db = $DIC->database();
    47         if (isset($this->object_data_cache[$obj_id])) {
    48             unset($this->object_data_cache[$obj_id]);
    59         return (
int) ($this->reference_cache[
$ref_id] ?? 0);
    68         return (
string) ($this->object_data_cache[$obj_id][
'title'] ?? 
'');
    77         return (
string) ($this->object_data_cache[$obj_id][
'type'] ?? 
'');
    86         return (
int) ($this->object_data_cache[$obj_id][
'owner'] ?? 0);
    95         return (
string) ($this->object_data_cache[$obj_id][
'description'] ?? 
'');
   103         return (
string) ($this->object_data_cache[$obj_id][
'last_update']);
   115         return (
bool) ($this->object_data_cache[$obj_id][
'offline'] ?? 
false);
   125         if (isset($this->reference_cache[$ref_id])) {
   137         if (isset($this->object_data_cache[$obj_id])) {
   152             "SELECT obj_id" . PHP_EOL
   153             . 
"FROM object_reference" . PHP_EOL
   154             . 
"WHERE ref_id = " . $this->db->quote($ref_id, 
'integer') . PHP_EOL
   156         $result = $this->db->query($sql);
   158             $this->reference_cache[
$ref_id] = (
int) $row[
'obj_id'];
   161         return (
int) ($this->reference_cache[
$ref_id] ?? 0);
   171         $obj_definition = $DIC[
"objDefinition"];
   172         $user = $DIC[
"ilUser"];
   175             "SELECT object_data.obj_id, object_data.type, object_data.title, object_data.description, " . PHP_EOL
   176             . 
"object_data.owner, object_data.create_date, object_data.last_update, object_data.import_id, " . PHP_EOL
   177             . 
"object_data.offline, object_description.description as long_description " . PHP_EOL
   178             . 
"FROM object_data LEFT JOIN object_description ON object_data.obj_id = object_description.obj_id " . PHP_EOL
   179             . 
"WHERE object_data.obj_id = " . $this->db->quote($obj_id, 
'integer') . PHP_EOL
   181         $res = $this->db->query($sql);
   183             $this->object_data_cache[$obj_id][
'title'] = $row->title;
   184             $this->object_data_cache[$obj_id][
'description'] = $row->description;
   185             if ($row->long_description !== null) {
   186                 $this->object_data_cache[$row->obj_id][
'description'] = $row->long_description;
   188             $this->object_data_cache[$obj_id][
'type'] = $row->type;
   189             $this->object_data_cache[$obj_id][
'owner'] = $row->owner;
   190             $this->object_data_cache[$obj_id][
'last_update'] = $row->last_update;
   191             $this->object_data_cache[$obj_id][
'offline'] = $row->offline;
   193             $translation_type = $obj_definition->getTranslationType($row->type);
   195             if ($translation_type === 
"db" && !isset($this->trans_loaded[$obj_id])) {
   197                     "SELECT title, description" . PHP_EOL
   198                     . 
"FROM object_translation" . PHP_EOL
   199                     . 
"WHERE obj_id = " . $this->db->quote($obj_id, 
'integer') . PHP_EOL
   200                     . 
"AND lang_code = " . $this->db->quote($user->getLanguage(), 
'text') . PHP_EOL
   202                 $trans_res = $this->db->query($sql);
   206                     $this->object_data_cache[$obj_id][
'title'] = $trans_row->title;
   207                     $this->object_data_cache[$obj_id][
'description'] = $trans_row->description;
   208                     $this->description_trans[] = $obj_id;
   210                 $this->trans_loaded[$obj_id] = 
true;
   217         return in_array($obj_id, $this->description_trans);
   229         $obj_definition = $DIC[
"objDefinition"];
   230         $user = $DIC[
"ilUser"];
   233             $lang = $user->getLanguage();
   236         if ($obj_ids === []) {
   241             "SELECT object_data.obj_id, object_data.type, object_data.title, object_data.description, " . PHP_EOL
   242             . 
"object_data.owner, object_data.create_date, object_data.last_update, object_data.import_id, " . PHP_EOL
   243             . 
"object_data.offline, object_description.description as long_description " . PHP_EOL
   244             . 
"FROM object_data LEFT JOIN object_description ON object_data.obj_id = object_description.obj_id " . PHP_EOL
   245             . 
"WHERE " . $this->db->in(
'object_data.obj_id', $obj_ids, 
false, 
'integer') . PHP_EOL
   247         $res = $this->db->query($sql);
   250             $obj_id = (
int) $row->obj_id;
   252             if (!isset($this->trans_loaded[$obj_id])) {
   253                 $this->object_data_cache[$obj_id][
'title'] = $row->title;
   254                 $this->object_data_cache[$obj_id][
'description'] = $row->description;
   255                 if ($row->long_description !== null) {
   256                     $this->object_data_cache[$row->obj_id][
'description'] = $row->long_description;
   259             $this->object_data_cache[$obj_id][
'type'] = $row->type;
   260             $this->object_data_cache[$obj_id][
'owner'] = $row->owner;
   261             $this->object_data_cache[$obj_id][
'last_update'] = $row->last_update;
   262             $this->object_data_cache[$obj_id][
'offline'] = $row->offline;
   264             $translation_type = $obj_definition->getTranslationType($row->type);
   266             if ($translation_type === 
"db") {
   267                 $db_trans[$obj_id] = $obj_id;
   271         if (count($db_trans) > 0) {
   284         foreach ($obj_ids as 
$id) {
   286             if (!isset($this->trans_loaded[$id])) {
   288                 $this->trans_loaded[
$id] = 
true;
   294                 "SELECT obj_id, title, description" . PHP_EOL
   295                 . 
"FROM object_translation" . PHP_EOL
   296                 . 
"WHERE " . $this->db->in(
'obj_id', $ids, 
false, 
'integer') . PHP_EOL
   297                 . 
"AND lang_code = " . $this->db->quote($lang, 
'text') . PHP_EOL
   299             $result = $this->db->query($sql);
   301                 $obj_id = (
int) $row->obj_id;
   303                 $this->object_data_cache[$obj_id][
'title'] = $row->title;
   304                 $this->object_data_cache[$obj_id][
'description'] = $row->description;
   305                 $this->description_trans[] = $obj_id;
   316         if ($ref_ids === []) {
   321             "SELECT ref_id, obj_id" . PHP_EOL
   322             . 
"FROM object_reference" . PHP_EOL
   323             . 
"WHERE " . $this->db->in(
'ref_id', $ref_ids, 
false, 
'integer') . PHP_EOL
   325         $res = $this->db->query($sql);
   329             $this->reference_cache[(
int) $row[
'ref_id']] = (
int) $row[
'obj_id'];
   330             $obj_ids[] = (
int) $row[
'obj_id'];
 
__isReferenceCached(int $ref_id)
checks whether a reference id is already in cache or not 
 
lookupDescription(int $obj_id)
 
preloadTranslations(array $obj_ids, string $lang)
Preload translation information. 
 
if(!file_exists(getcwd() . '/ilias.ini.php'))
 
__storeReference(int $ref_id)
Stores Reference in cache. 
 
__storeObjectData(int $obj_id)
Stores object data in cache. 
 
__isObjectCached(int $obj_id)
checks whether an object is already in cache or not 
 
lookupLastUpdate(int $obj_id)
 
preloadReferenceCache(array $ref_ids, bool $incl_obj=true)
 
isTranslatedDescription(int $obj_id)
 
preloadObjectCache(array $obj_ids, string $lang='')
Stores object data in cache. 
 
lookupOfflineStatus(int $obj_id)
Check if supports centralized offline handling and is offline. 
 
deleteCachedEntry(int $obj_id)
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins