115 protected function readFromDB()
118 $ilDB = $DIC->database();
123 $set =
$ilDB->query(
'SELECT * FROM il_component');
124 while ($rec =
$ilDB->fetchAssoc($set)) {
125 $this->il_component[$rec[
'id']] = $rec;
126 $this->obj_def_name_to_id[$rec[
'id']] = $rec[
'name'];
127 $this->obj_def_name_and_type_raw[$rec[
'type']][$rec[
'name']] = $rec;
130 $set =
$ilDB->query(
'SELECT * FROM il_object_def');
131 while ($rec =
$ilDB->fetchAssoc($set)) {
132 $this->il_object_def[$rec[
'id']] = $rec;
135 $set =
$ilDB->query(
'SELECT * FROM il_object_subobj');
136 while ($rec =
$ilDB->fetchAssoc($set)) {
137 $this->il_object_subobj[] = $rec;
138 $parent = $rec[
'parent'];
139 $this->subobj_for_parent[$parent][] = $rec;
141 $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');
142 while ($rec =
$ilDB->fetchAssoc($set)) {
143 $this->grouped_rep_obj_types[$rec[
'parent']][] = $rec;
146 $set =
$ilDB->query(
'SELECT * FROM il_pluginslot');
147 while ($rec =
$ilDB->fetchAssoc($set)) {
148 $this->il_pluginslot_by_comp[$rec[
'component']][] = $rec;
149 $this->il_pluginslot_by_id[$rec[
'id']] = $rec;
150 $this->il_pluginslot_by_name[$rec[
'name']] = $rec;
153 $set =
$ilDB->query(
'SELECT * FROM il_plugin');
154 $this->il_plugin_active = array();
155 while ($rec =
$ilDB->fetchAssoc($set)) {
156 $this->il_plugin_by_id[$rec[
'plugin_id']] = $rec;
157 $this->il_plugin_by_name[$rec[
'name']] = $rec;
158 if ($rec[
'active'] == 1) {
159 $this->il_plugin_active[$rec[
'slot_id']][] = $rec;
162 $set =
$ilDB->query(
'SELECT * FROM il_object_group');
163 while ($rec =
$ilDB->fetchAssoc($set)) {
164 $this->il_object_group[$rec[
'id']] = $rec;
166 $set =
$ilDB->query(
'SELECT * FROM il_object_sub_type');
167 while ($rec =
$ilDB->fetchAssoc($set)) {
168 $this->il_object_sub_type[$rec[
'obj_type']][] = $rec;
295 $this->il_pluginslot_by_comp = $il_pluginslot_by_service;
430 if (!isset(self::$instance)) {
432 $cached_obj = $global_cache->get(
'ilCachedComponentData');
434 self::$instance = $cached_obj;
436 self::$instance =
new self();
437 $global_cache->set(
'ilCachedComponentData', self::$instance);
441 return self::$instance;
448 self::$instance = null;
459 return $this->il_plugin_by_name[
$name];
470 if (is_array($this->il_plugin_active[$slot_id])) {
471 return $this->il_plugin_active[$slot_id];
485 if (is_array($parent)) {
486 $index = md5(serialize($parent));
487 if (isset($this->cached_results[
'subop_par'][
$index])) {
488 return $this->cached_results[
'subop_par'][
$index];
492 foreach ($parent as $p) {
493 if (is_array($this->subobj_for_parent[$p])) {
494 foreach ($this->subobj_for_parent[$p] as $rec) {
500 $this->cached_results[
'subop_par'][
$index] = $return;
501 $this->changed =
true;
506 return $this->subobj_for_parent[$parent];
518 return $this->obj_def_name_and_type_raw[
$type][
$name][
'id'];
531 if (isset($this->obj_def_name_and_type_raw[
'Modules'][
$name])) {
538 return $this->obj_def_name_and_type_raw[
$type][
$name];
545 if ($this->changed && $ilGlobalCache->isActive()) {
546 $this->changed =
false;
547 $ilGlobalCache->set(
'ilCachedComponentData', $this);
559 if (is_array($parent)) {
560 $index = md5(serialize($parent));
561 if (isset($this->cached_results[
'grpd_repo'][
$index])) {
562 return $this->cached_results[
'grpd_repo'][
$index];
567 foreach ($parent as $p) {
568 $s = $this->grouped_rep_obj_types[$p];
569 foreach (
$s as $child) {
570 if (!in_array($child[
'sid'], $sids)) {
571 $sids[] = $child[
'sid'];
576 $this->changed =
true;
577 $this->cached_results[
'grpd_repo'][
$index] = $return;
581 return $this->grouped_rep_obj_types[$parent];
593 if (is_array($this->il_pluginslot_by_comp[$component])) {
594 return $this->il_pluginslot_by_comp[$component];
608 return $this->il_pluginslot_by_id[
$id];
619 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)
lookupPluginSlotByName($name)
setIlObjectGroup($il_object_group)
lookupCompInfo($type, $name)
lookupPluginSlotByComponent($component)
setIlObjectSubobj($il_object_subobj)
lookupGroupedRepObj($parent)
setObjDefNameAndTypeRaw($obj_def_name_and_type_raw)