111 protected function readFromDB() {
117 $set = $ilDB->query(
'SELECT * FROM il_component');
118 while ($rec = $ilDB->fetchAssoc($set)) {
119 $this->il_component[$rec[
'id']] = $rec;
120 $this->obj_def_name_to_id[$rec[
'id']] = $rec[
'name'];
121 $this->obj_def_name_and_type_raw[$rec[
'type']][$rec[
'name']] = $rec;
124 $set = $ilDB->query(
'SELECT * FROM il_object_def');
125 while ($rec = $ilDB->fetchAssoc($set)) {
126 $this->il_object_def[$rec[
'id']] = $rec;
129 $set = $ilDB->query(
'SELECT * FROM il_object_subobj');
130 while ($rec = $ilDB->fetchAssoc($set)) {
131 $this->il_object_subobj[] = $rec;
132 $parent = $rec[
'parent'];
133 $this->subobj_for_parent[$parent][] = $rec;
135 $set = $ilDB->query(
'SELECT DISTINCT(id) AS sid, parent, il_object_def.* FROM il_object_def, il_object_subobj WHERE NOT (system = 1) AND NOT (sideblock = 1) AND subobj = id');
136 while ($rec = $ilDB->fetchAssoc($set)) {
137 $this->grouped_rep_obj_types[$rec[
'parent']][] = $rec;
140 $set = $ilDB->query(
'SELECT * FROM il_pluginslot');
141 while ($rec = $ilDB->fetchAssoc($set)) {
142 $this->il_pluginslot_by_comp[$rec[
'component']][] = $rec;
143 $this->il_pluginslot_by_id[$rec[
'id']] = $rec;
144 $this->il_pluginslot_by_name[$rec[
'name']] = $rec;
147 $set = $ilDB->query(
'SELECT * FROM il_plugin');
148 $this->il_plugin_active =
array();
149 while ($rec = $ilDB->fetchAssoc($set)) {
150 $this->il_plugin_by_id[$rec[
'plugin_id']] = $rec;
151 $this->il_plugin_by_name[$rec[
'name']] = $rec;
152 if ($rec[
'active'] == 1) {
153 $this->il_plugin_active[$rec[
'slot_id']][] = $rec;
156 $set = $ilDB->query(
'SELECT * FROM il_object_group');
157 while ($rec = $ilDB->fetchAssoc($set)) {
158 $this->il_object_group[$rec[
'id']] = $rec;
160 $set = $ilDB->query(
'SELECT * FROM il_object_sub_type');
161 while ($rec = $ilDB->fetchAssoc($set)) {
162 $this->il_object_sub_type[$rec[
'obj_type']][] = $rec;
275 $this->il_pluginslot_by_comp = $il_pluginslot_by_service;
395 if (!isset(self::$instance)) {
397 $cached_obj = $global_cache->get(
'ilCachedComponentData');
399 self::$instance = $cached_obj;
401 self::$instance =
new self();
402 $global_cache->set(
'ilCachedComponentData', self::$instance);
406 return self::$instance;
412 self::$instance = null;
422 return $this->il_plugin_by_name[$name];
432 if (is_array($this->il_plugin_active[$slot_id])) {
433 return $this->il_plugin_active[$slot_id];
446 if (is_array($parent)) {
447 $index = md5(serialize($parent));
448 if (isset($this->cached_results[
'subop_par'][$index])) {
449 return $this->cached_results[
'subop_par'][$index];
453 foreach ($parent as $p) {
454 if (is_array($this->subobj_for_parent[$p])) {
455 foreach ($this->subobj_for_parent[$p] as $rec) {
461 $this->cached_results[
'subop_par'][$index] = $return;
462 $this->changed =
true;
467 return $this->subobj_for_parent[$parent];
478 return $this->obj_def_name_and_type_raw[$type][$name][
'id'];
490 if (isset($this->obj_def_name_and_type_raw[
'Modules'][$name])) {
497 return $this->obj_def_name_and_type_raw[$type][$name];
503 if ($this->changed && $ilGlobalCache->isActive()) {
504 $this->changed =
false;
505 $ilGlobalCache->set(
'ilCachedComponentData', $this);
516 if (is_array($parent)) {
517 $index = md5(serialize($parent));
518 if (isset($this->cached_results[
'grpd_repo'][$index])) {
519 return $this->cached_results[
'grpd_repo'][$index];
524 foreach ($parent as $p) {
525 $s = $this->grouped_rep_obj_types[$p];
526 foreach ($s as $child) {
527 if (!in_array($child[
'sid'], $sids)) {
528 $sids[] = $child[
'sid'];
533 $this->changed =
true;
534 $this->cached_results[
'grpd_repo'][$index] = $return;
538 return $this->grouped_rep_obj_types[$parent];
549 if (is_array($this->il_pluginslot_by_comp[$component])) {
550 return $this->il_pluginslot_by_comp[$component];
563 return $this->il_pluginslot_by_id[$id];
573 return $this->il_pluginslot_by_name[$name];
getObjDefNameAndTypeRaw()
setIlPluginslotByName($il_pluginslot_by_name)
setIlPluginslotByComp($il_pluginslot_by_service)
setIlComponent($il_component)
setIlObjectSubType($il_object_sub_type)
static getInstance($component)
lookupPluginSlotById($id)
Class ilCachedComponentData.
setGroupedRepObjTypes($grouped_rep_obj_types)
lookupActivePluginsBySlotId($slot_id)
setIlObjectDef($il_object_def)
setIlPluginslotById($il_pluginslot_by_id)
setIlPluginActive($il_plugin_active)
$obj_def_name_and_type_raw
setIlPluginById($il_plugin_by_id)
lookupPluginByName($name)
setIlPluginByName($il_plugin_by_name)
lookupSubObjForParent($parent)
setObjDefNameToId($obj_def_name_to_id)
setSubobjForParent($subobj_for_parent)
Create styles array
The data for the language used.
lookupPluginSlotByName($name)
setIlObjectGroup($il_object_group)
lookupCompInfo($type, $name)
lookupPluginSlotByComponent($component)
setIlObjectSubobj($il_object_subobj)
lookupGroupedRepObj($parent)
setObjDefNameAndTypeRaw($obj_def_name_and_type_raw)