115 protected function readFromDB()
122 $set = $ilDB->query(
'SELECT * FROM il_component');
123 while ($rec = $ilDB->fetchAssoc($set)) {
124 $this->il_component[$rec[
'id']] = $rec;
125 $this->obj_def_name_to_id[$rec[
'id']] = $rec[
'name'];
126 $this->obj_def_name_and_type_raw[$rec[
'type']][$rec[
'name']] = $rec;
129 $set = $ilDB->query(
'SELECT * FROM il_object_def');
130 while ($rec = $ilDB->fetchAssoc($set)) {
131 $this->il_object_def[$rec[
'id']] = $rec;
134 $set = $ilDB->query(
'SELECT * FROM il_object_subobj');
135 while ($rec = $ilDB->fetchAssoc($set)) {
136 $this->il_object_subobj[] = $rec;
137 $parent = $rec[
'parent'];
138 $this->subobj_for_parent[$parent][] = $rec;
140 $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');
141 while ($rec = $ilDB->fetchAssoc($set)) {
142 $this->grouped_rep_obj_types[$rec[
'parent']][] = $rec;
145 $set = $ilDB->query(
'SELECT * FROM il_pluginslot');
146 while ($rec = $ilDB->fetchAssoc($set)) {
147 $this->il_pluginslot_by_comp[$rec[
'component']][] = $rec;
148 $this->il_pluginslot_by_id[$rec[
'id']] = $rec;
149 $this->il_pluginslot_by_name[$rec[
'name']] = $rec;
152 $set = $ilDB->query(
'SELECT * FROM il_plugin');
153 $this->il_plugin_active =
array();
154 while ($rec = $ilDB->fetchAssoc($set)) {
155 $this->il_plugin_by_id[$rec[
'plugin_id']] = $rec;
156 $this->il_plugin_by_name[$rec[
'name']] = $rec;
157 if ($rec[
'active'] == 1) {
158 $this->il_plugin_active[$rec[
'slot_id']][] = $rec;
161 $set = $ilDB->query(
'SELECT * FROM il_object_group');
162 while ($rec = $ilDB->fetchAssoc($set)) {
163 $this->il_object_group[$rec[
'id']] = $rec;
165 $set = $ilDB->query(
'SELECT * FROM il_object_sub_type');
166 while ($rec = $ilDB->fetchAssoc($set)) {
167 $this->il_object_sub_type[$rec[
'obj_type']][] = $rec;
294 $this->il_pluginslot_by_comp = $il_pluginslot_by_service;
429 if (!isset(self::$instance)) {
431 $cached_obj = $global_cache->get(
'ilCachedComponentData');
433 self::$instance = $cached_obj;
435 self::$instance =
new self();
436 $global_cache->set(
'ilCachedComponentData', self::$instance);
440 return self::$instance;
447 self::$instance = null;
458 return $this->il_plugin_by_name[
$name];
469 if (is_array($this->il_plugin_active[$slot_id])) {
470 return $this->il_plugin_active[$slot_id];
484 if (is_array($parent)) {
485 $index = md5(serialize($parent));
486 if (isset($this->cached_results[
'subop_par'][
$index])) {
487 return $this->cached_results[
'subop_par'][
$index];
491 foreach ($parent as $p) {
492 if (is_array($this->subobj_for_parent[$p])) {
493 foreach ($this->subobj_for_parent[$p] as $rec) {
499 $this->cached_results[
'subop_par'][
$index] = $return;
500 $this->changed =
true;
505 return $this->subobj_for_parent[$parent];
517 return $this->obj_def_name_and_type_raw[
$type][
$name][
'id'];
530 if (isset($this->obj_def_name_and_type_raw[
'Modules'][
$name])) {
537 return $this->obj_def_name_and_type_raw[
$type][
$name];
544 if ($this->changed && $ilGlobalCache->isActive()) {
545 $this->changed =
false;
546 $ilGlobalCache->set(
'ilCachedComponentData', $this);
558 if (is_array($parent)) {
559 $index = md5(serialize($parent));
560 if (isset($this->cached_results[
'grpd_repo'][
$index])) {
561 return $this->cached_results[
'grpd_repo'][
$index];
566 foreach ($parent as $p) {
567 $s = $this->grouped_rep_obj_types[$p];
568 foreach (
$s as $child) {
569 if (!in_array($child[
'sid'], $sids)) {
570 $sids[] = $child[
'sid'];
575 $this->changed =
true;
576 $this->cached_results[
'grpd_repo'][
$index] = $return;
580 return $this->grouped_rep_obj_types[$parent];
592 if (is_array($this->il_pluginslot_by_comp[$component])) {
593 return $this->il_pluginslot_by_comp[$component];
607 return $this->il_pluginslot_by_id[
$id];
618 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)
if(!array_key_exists('StateId', $_REQUEST)) $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)