119 protected function readFromDB()
122 $ilDB = $DIC->database();
127 $set =
$ilDB->query(
'SELECT * FROM il_component');
128 while ($rec =
$ilDB->fetchAssoc($set)) {
129 $this->il_component[$rec[
'id']] = $rec;
130 $this->obj_def_name_to_id[$rec[
'id']] = $rec[
'name'];
131 $this->obj_def_name_and_type_raw[$rec[
'type']][$rec[
'name']] = $rec;
134 $set =
$ilDB->query(
'SELECT * FROM il_object_def');
135 while ($rec =
$ilDB->fetchAssoc($set)) {
136 $this->il_object_def[$rec[
'id']] = $rec;
139 $set =
$ilDB->query(
'SELECT * FROM il_object_subobj');
140 while ($rec =
$ilDB->fetchAssoc($set)) {
141 $this->il_object_subobj[] = $rec;
142 $parent = $rec[
'parent'];
143 $this->subobj_for_parent[$parent][] = $rec;
145 $set =
$ilDB->query(
'SELECT DISTINCT(id) AS sid, parent, il_object_def.* FROM il_object_def, il_object_subobj WHERE NOT (' .
$ilDB->quoteIdentifier(
'system') .
' = 1) AND NOT (sideblock = 1) AND subobj = id');
146 while ($rec =
$ilDB->fetchAssoc($set)) {
147 $this->grouped_rep_obj_types[$rec[
'parent']][] = $rec;
150 $set =
$ilDB->query(
'SELECT * FROM il_pluginslot');
151 while ($rec =
$ilDB->fetchAssoc($set)) {
152 $this->il_pluginslot_by_comp[$rec[
'component']][] = $rec;
153 $this->il_pluginslot_by_id[$rec[
'id']] = $rec;
154 $this->il_pluginslot_by_name[$rec[
'name']] = $rec;
157 $set =
$ilDB->query(
'SELECT * FROM il_plugin');
158 $this->il_plugin_active = array();
159 while ($rec =
$ilDB->fetchAssoc($set)) {
160 $this->il_plugin_by_id[$rec[
'plugin_id']] = $rec;
161 $this->il_plugin_by_name[$rec[
'name']] = $rec;
162 $this->il_plugin_by_slotid[$rec[
'slot_id']][] = $rec;
163 if ($rec[
'active'] == 1) {
164 $this->il_plugin_active[$rec[
'slot_id']][] = $rec;
167 $set =
$ilDB->query(
'SELECT * FROM il_object_group');
168 while ($rec =
$ilDB->fetchAssoc($set)) {
169 $this->il_object_group[$rec[
'id']] = $rec;
171 $set =
$ilDB->query(
'SELECT * FROM il_object_sub_type');
172 while ($rec =
$ilDB->fetchAssoc($set)) {
173 $this->il_object_sub_type[$rec[
'obj_type']][] = $rec;
300 $this->il_pluginslot_by_comp = $il_pluginslot_by_service;
435 if (!isset(self::$instance)) {
437 $cached_obj = $global_cache->get(
'ilCachedComponentData');
439 self::$instance = $cached_obj;
441 self::$instance =
new self();
442 $global_cache->set(
'ilCachedComponentData', self::$instance);
446 return self::$instance;
453 self::$instance = null;
464 return $this->il_plugin_by_name[
$name];
475 if (isset($this->il_plugin_active[$slot_id]) && is_array($this->il_plugin_active[$slot_id])) {
476 return $this->il_plugin_active[$slot_id];
489 return $this->il_plugin_by_slotid[$slot_id];
499 if (is_array($parent)) {
500 $index = md5(serialize($parent));
501 if (isset($this->cached_results[
'subop_par'][
$index])) {
502 return $this->cached_results[
'subop_par'][
$index];
506 foreach ($parent as $p) {
507 if (is_array($this->subobj_for_parent[$p])) {
508 foreach ($this->subobj_for_parent[$p] as $rec) {
514 $this->cached_results[
'subop_par'][
$index] = $return;
515 $this->changed =
true;
520 return $this->subobj_for_parent[$parent];
532 return $this->obj_def_name_and_type_raw[
$type][
$name][
'id'];
545 if (isset($this->obj_def_name_and_type_raw[
'Modules'][
$name])) {
552 return $this->obj_def_name_and_type_raw[
$type][
$name];
559 if ($this->changed && $ilGlobalCache->isActive()) {
560 $this->changed =
false;
561 $ilGlobalCache->set(
'ilCachedComponentData', $this);
573 if (is_array($parent)) {
574 $index = md5(serialize($parent));
575 if (isset($this->cached_results[
'grpd_repo'][
$index])) {
576 return $this->cached_results[
'grpd_repo'][
$index];
581 foreach ($parent as $p) {
582 $s = $this->grouped_rep_obj_types[$p];
583 foreach ($s as $child) {
584 if (!in_array($child[
'sid'], $sids)) {
585 $sids[] = $child[
'sid'];
590 $this->changed =
true;
591 $this->cached_results[
'grpd_repo'][
$index] = $return;
595 return $this->grouped_rep_obj_types[$parent];
607 if (isset($this->il_pluginslot_by_comp[$component]) && is_array($this->il_pluginslot_by_comp[$component])) {
608 return $this->il_pluginslot_by_comp[$component];
622 return $this->il_pluginslot_by_id[$id];
633 return $this->il_pluginslot_by_name[
$name];
getObjDefNameAndTypeRaw()
setIlPluginslotByName($il_pluginslot_by_name)
setIlPluginslotByComp($il_pluginslot_by_service)
lookupPluginsBySlotId($slot_id)
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)
lookupPluginSlotByName($name)
setIlObjectGroup($il_object_group)
lookupCompInfo($type, $name)
lookupPluginSlotByComponent($component)
setIlObjectSubobj($il_object_subobj)
lookupGroupedRepObj($parent)
setObjDefNameAndTypeRaw($obj_def_name_and_type_raw)