ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilCachedComponentData Class Reference

Class ilCachedComponentData. More...

+ Collaboration diagram for ilCachedComponentData:

Public Member Functions

 getLoaded ()
 
 setLoaded ($loaded)
 
 getIlComponent ()
 
 setIlComponent ($il_component)
 
 getObjDefNameAndTypeRaw ()
 
 setObjDefNameAndTypeRaw ($obj_def_name_and_type_raw)
 
 getObjDefNameToId ()
 
 setObjDefNameToId ($obj_def_name_to_id)
 
 getIlObjectDef ()
 
 setIlObjectDef ($il_object_def)
 
 getIlObjectSubobj ()
 
 setIlObjectSubobj ($il_object_subobj)
 
 getGroupedRepObjTypes ()
 
 setGroupedRepObjTypes ($grouped_rep_obj_types)
 
 getIlPluginslotByComp ()
 
 setIlPluginslotByComp ($il_pluginslot_by_service)
 
 getIlPluginslotById ()
 
 setIlPluginslotById ($il_pluginslot_by_id)
 
 getIlPluginslotByName ()
 
 setIlPluginslotByName ($il_pluginslot_by_name)
 
 getIlPluginById ()
 
 setIlPluginById ($il_plugin_by_id)
 
 getIlPluginByName ()
 
 setIlPluginByName ($il_plugin_by_name)
 
 getIlPluginActive ()
 
 setIlPluginActive ($il_plugin_active)
 
 getIlObjectGroup ()
 
 setIlObjectGroup ($il_object_group)
 
 getIlObjectSubType ()
 
 setIlObjectSubType ($il_object_sub_type)
 
 lookupPluginByName ($name)
 
 lookupActivePluginsBySlotId ($slot_id)
 
 lookupSubObjForParent ($parent)
 
 lookCompId ($type, $name)
 
 lookupCompInfo ($type, $name)
 
 __destruct ()
 
 lookupGroupedRepObj ($parent)
 
 lookupPluginSlotByComponent ($component)
 
 lookupPluginSlotById ($id)
 
 lookupPluginSlotByName ($name)
 
 getSubobjForParent ()
 
 setSubobjForParent ($subobj_for_parent)
 

Static Public Member Functions

static getInstance ()
 
static flush ()
 

Protected Member Functions

 __construct ()
 

Protected Attributes

 $cached_results = array()
 
 $changed = false
 
 $loaded = false
 
 $obj_def_name_to_id = array()
 
 $obj_def_name_and_type_raw = array()
 
 $il_component = array()
 
 $il_object_def = array()
 
 $il_object_subobj = array()
 
 $subobj_for_parent = array()
 
 $grouped_rep_obj_types = array()
 
 $il_pluginslot_by_comp = array()
 
 $il_pluginslot_by_id = array()
 
 $il_pluginslot_by_name = array()
 
 $il_plugin_by_id = array()
 
 $il_object_group = array()
 
 $il_object_sub_type = array()
 
 $il_plugin_active = array()
 
 $il_plugin_by_name = array()
 

Static Protected Attributes

static $instance
 

Detailed Description

Class ilCachedComponentData.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 10 of file class.ilCachedComponentData.php.

Constructor & Destructor Documentation

◆ __construct()

ilCachedComponentData::__construct ( )
protected

Definition at line 90 of file class.ilCachedComponentData.php.

90 {
92 $this->readFromDB();
93 }
static getInstance($component)

References ilGlobalCache\COMP_COMPONENT, and ilGlobalCache\getInstance().

+ Here is the call graph for this function:

◆ __destruct()

ilCachedComponentData::__destruct ( )

Definition at line 502 of file class.ilCachedComponentData.php.

502 {
504 if ($this->changed && $ilGlobalCache->isActive()) {
505 $this->changed = false;
506 $ilGlobalCache->set('ilCachedComponentData', $this);
507 }
508 }

References ilGlobalCache\COMP_COMPONENT, and ilGlobalCache\getInstance().

+ Here is the call graph for this function:

Member Function Documentation

◆ flush()

static ilCachedComponentData::flush ( )
static

Definition at line 411 of file class.ilCachedComponentData.php.

411 {
413 self::$instance = NULL;
414 }

References ilGlobalCache\COMP_COMPONENT, and ilGlobalCache\getInstance().

Referenced by ilPlugin\activate(), ilPlugin\createPluginRecord(), ilPlugin\deactivate(), ilPlugin\uninstall(), ilPlugin\update(), and ilPlugin\updateDatabase().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupedRepObjTypes()

ilCachedComponentData::getGroupedRepObjTypes ( )
Returns
array

Definition at line 251 of file class.ilCachedComponentData.php.

References $grouped_rep_obj_types.

◆ getIlComponent()

ilCachedComponentData::getIlComponent ( )
Returns
array

Definition at line 171 of file class.ilCachedComponentData.php.

References $il_component.

◆ getIlObjectDef()

ilCachedComponentData::getIlObjectDef ( )
Returns
array

Definition at line 219 of file class.ilCachedComponentData.php.

References $il_object_def.

◆ getIlObjectGroup()

ilCachedComponentData::getIlObjectGroup ( )
Returns
array

Definition at line 363 of file class.ilCachedComponentData.php.

References $il_object_group.

◆ getIlObjectSubobj()

ilCachedComponentData::getIlObjectSubobj ( )
Returns
array

Definition at line 235 of file class.ilCachedComponentData.php.

References $il_object_subobj.

◆ getIlObjectSubType()

ilCachedComponentData::getIlObjectSubType ( )
Returns
array

Definition at line 379 of file class.ilCachedComponentData.php.

References $il_object_sub_type.

◆ getIlPluginActive()

ilCachedComponentData::getIlPluginActive ( )
Returns
array

Definition at line 347 of file class.ilCachedComponentData.php.

References $il_plugin_active.

◆ getIlPluginById()

ilCachedComponentData::getIlPluginById ( )
Returns
array

Definition at line 315 of file class.ilCachedComponentData.php.

References $il_plugin_by_id.

◆ getIlPluginByName()

ilCachedComponentData::getIlPluginByName ( )
Returns
array

Definition at line 331 of file class.ilCachedComponentData.php.

References $il_plugin_by_name.

◆ getIlPluginslotByComp()

ilCachedComponentData::getIlPluginslotByComp ( )
Returns
array

Definition at line 267 of file class.ilCachedComponentData.php.

References $il_pluginslot_by_comp.

◆ getIlPluginslotById()

ilCachedComponentData::getIlPluginslotById ( )
Returns
array

Definition at line 283 of file class.ilCachedComponentData.php.

References $il_pluginslot_by_id.

◆ getIlPluginslotByName()

ilCachedComponentData::getIlPluginslotByName ( )
Returns
array

Definition at line 299 of file class.ilCachedComponentData.php.

References $il_pluginslot_by_name.

◆ getInstance()

static ilCachedComponentData::getInstance ( )
static
Returns
ilCachedComponentData

Definition at line 395 of file class.ilCachedComponentData.php.

395 {
396 if (!isset(self::$instance)) {
398 $cached_obj = $global_cache->get('ilCachedComponentData');
399 if ($cached_obj instanceof ilCachedComponentData) {
400 self::$instance = $cached_obj;
401 } else {
402 self::$instance = new self();
403 $global_cache->set('ilCachedComponentData', self::$instance);
404 }
405 }
406
407 return self::$instance;
408 }
Class ilCachedComponentData.

References $instance, ilGlobalCache\COMP_COMPONENT, and ilGlobalCache\getInstance().

Referenced by ilComponent\__construct(), ilPlugin\getActivePluginsForSlot(), ilPluginSlot\getAllSlots(), ilComponent\getComponentInfo(), ilObjectDefinition\getGroupedRepositoryObjectTypes(), ilPlugin\getPluginObject(), ilPlugin\getPluginRecord(), ilComponent\lookupId(), ilComponent\lookupPluginSlots(), ilPluginSlot\lookupSlotId(), ilPluginSlot\lookupSlotName(), ilPluginSlot\read(), and ilObjectDefinition\readDefinitionDataFromCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLoaded()

ilCachedComponentData::getLoaded ( )
Returns
boolean

Definition at line 99 of file class.ilCachedComponentData.php.

References $loaded.

◆ getObjDefNameAndTypeRaw()

ilCachedComponentData::getObjDefNameAndTypeRaw ( )
Returns
array

Definition at line 187 of file class.ilCachedComponentData.php.

References $obj_def_name_and_type_raw.

◆ getObjDefNameToId()

ilCachedComponentData::getObjDefNameToId ( )
Returns
array

Definition at line 203 of file class.ilCachedComponentData.php.

References $obj_def_name_to_id.

◆ getSubobjForParent()

ilCachedComponentData::getSubobjForParent ( )
Returns
array

Definition at line 581 of file class.ilCachedComponentData.php.

References $subobj_for_parent.

◆ lookCompId()

ilCachedComponentData::lookCompId (   $type,
  $name 
)
Parameters
$name
$type
Returns
mixed

Definition at line 478 of file class.ilCachedComponentData.php.

478 {
479 return $this->obj_def_name_and_type_raw[$type][$name]['id'];
480 }

◆ lookupActivePluginsBySlotId()

ilCachedComponentData::lookupActivePluginsBySlotId (   $slot_id)
Parameters
$slot_id
Returns
mixed

Definition at line 432 of file class.ilCachedComponentData.php.

432 {
433 if (is_array($this->il_plugin_active[$slot_id])) {
434 return $this->il_plugin_active[$slot_id];
435 } else {
436 return array();
437 }
438 }

◆ lookupCompInfo()

ilCachedComponentData::lookupCompInfo (   $type,
  $name 
)
Parameters
$name
$type
Returns
mixed

Definition at line 489 of file class.ilCachedComponentData.php.

489 {
490 if (!$type) {
491 if (isset($this->obj_def_name_and_type_raw['Modules'][$name])) {
492 $type = 'Modules';
493 } else {
494 $type = 'Services';
495 }
496 }
497
498 return $this->obj_def_name_and_type_raw[$type][$name];
499 }

◆ lookupGroupedRepObj()

ilCachedComponentData::lookupGroupedRepObj (   $parent)
Parameters
$parent
Returns
mixed

Definition at line 516 of file class.ilCachedComponentData.php.

516 {
517 if (is_array($parent)) {
518 $index = md5(serialize($parent));
519 if (isset($cached_results['grpd_repo'][$index])) {
520 return $cached_results['grpd_repo'][$index];
521 }
522
523 $return = array();
524 $sids = array();
525 foreach ($parent as $p) {
526 $s = $this->grouped_rep_obj_types[$p];
527 foreach ($s as $child) {
528 if (!in_array($child['sid'], $sids)) {
529 $sids[] = $child['sid'];
530 $return[] = $child;
531 }
532 }
533 }
534 $this->changed = true;
535 $this->cached_results['grpd_repo'][$index] = $return;
536
537 return $return;
538 } else {
539 return $this->grouped_rep_obj_types[$parent];
540 }
541 }

References $cached_results.

◆ lookupPluginByName()

ilCachedComponentData::lookupPluginByName (   $name)
Parameters
$name
Returns
mixed

Definition at line 422 of file class.ilCachedComponentData.php.

422 {
423 return $this->il_plugin_by_name[$name];
424 }

◆ lookupPluginSlotByComponent()

ilCachedComponentData::lookupPluginSlotByComponent (   $component)
Parameters
$component
Returns
mixed

Definition at line 549 of file class.ilCachedComponentData.php.

549 {
550 if (is_array($this->il_pluginslot_by_comp[$component])) {
551 return $this->il_pluginslot_by_comp[$component];
552 }
553
554 return array();
555 }

◆ lookupPluginSlotById()

ilCachedComponentData::lookupPluginSlotById (   $id)
Parameters
$id
Returns
mixed

Definition at line 563 of file class.ilCachedComponentData.php.

563 {
564 return $this->il_pluginslot_by_id[$id];
565 }

◆ lookupPluginSlotByName()

ilCachedComponentData::lookupPluginSlotByName (   $name)
Parameters
$name
Returns
mixed

Definition at line 573 of file class.ilCachedComponentData.php.

573 {
574 return $this->il_pluginslot_by_name[$name];
575 }

◆ lookupSubObjForParent()

ilCachedComponentData::lookupSubObjForParent (   $parent)
Parameters
$parent
Returns
mixed

Definition at line 446 of file class.ilCachedComponentData.php.

446 {
447 if (is_array($parent)) {
448 $index = md5(serialize($parent));
449 if (isset($this->cached_results['subop_par'][$index])) {
450 return $this->cached_results['subop_par'][$index];
451 }
452
453 $return = array();
454 foreach ($parent as $p) {
455 if (is_array($this->subobj_for_parent[$p])) {
456 foreach ($this->subobj_for_parent[$p] as $rec) {
457 $return[] = $rec;
458 }
459 }
460 }
461
462 $this->cached_results['subop_par'][$index] = $return;
463 $this->changed = true;
464
465 return $return;
466 }
467
468 return $this->subobj_for_parent[$parent];
469 }

◆ setGroupedRepObjTypes()

ilCachedComponentData::setGroupedRepObjTypes (   $grouped_rep_obj_types)
Parameters
array$grouped_rep_obj_types

Definition at line 259 of file class.ilCachedComponentData.php.

259 {
260 $this->grouped_rep_obj_types = $grouped_rep_obj_types;
261 }

References $grouped_rep_obj_types.

◆ setIlComponent()

ilCachedComponentData::setIlComponent (   $il_component)
Parameters
array$il_component

Definition at line 179 of file class.ilCachedComponentData.php.

179 {
180 $this->il_component = $il_component;
181 }

References $il_component.

◆ setIlObjectDef()

ilCachedComponentData::setIlObjectDef (   $il_object_def)
Parameters
array$il_object_def

Definition at line 227 of file class.ilCachedComponentData.php.

227 {
228 $this->il_object_def = $il_object_def;
229 }

References $il_object_def.

◆ setIlObjectGroup()

ilCachedComponentData::setIlObjectGroup (   $il_object_group)
Parameters
array$il_object_group

Definition at line 371 of file class.ilCachedComponentData.php.

371 {
372 $this->il_object_group = $il_object_group;
373 }

References $il_object_group.

◆ setIlObjectSubobj()

ilCachedComponentData::setIlObjectSubobj (   $il_object_subobj)
Parameters
array$il_object_subobj

Definition at line 243 of file class.ilCachedComponentData.php.

243 {
244 $this->il_object_subobj = $il_object_subobj;
245 }

References $il_object_subobj.

◆ setIlObjectSubType()

ilCachedComponentData::setIlObjectSubType (   $il_object_sub_type)
Parameters
array$il_object_sub_type

Definition at line 387 of file class.ilCachedComponentData.php.

387 {
388 $this->il_object_sub_type = $il_object_sub_type;
389 }

References $il_object_sub_type.

◆ setIlPluginActive()

ilCachedComponentData::setIlPluginActive (   $il_plugin_active)
Parameters
array$il_plugin_active

Definition at line 355 of file class.ilCachedComponentData.php.

355 {
356 $this->il_plugin_active = $il_plugin_active;
357 }

References $il_plugin_active.

◆ setIlPluginById()

ilCachedComponentData::setIlPluginById (   $il_plugin_by_id)
Parameters
array$il_plugin_by_id

Definition at line 323 of file class.ilCachedComponentData.php.

323 {
324 $this->il_plugin_by_id = $il_plugin_by_id;
325 }

References $il_plugin_by_id.

◆ setIlPluginByName()

ilCachedComponentData::setIlPluginByName (   $il_plugin_by_name)
Parameters
array$il_plugin_by_name

Definition at line 339 of file class.ilCachedComponentData.php.

339 {
340 $this->il_plugin_by_name = $il_plugin_by_name;
341 }

References $il_plugin_by_name.

◆ setIlPluginslotByComp()

ilCachedComponentData::setIlPluginslotByComp (   $il_pluginslot_by_service)
Parameters
array$il_pluginslot_by_service

Definition at line 275 of file class.ilCachedComponentData.php.

275 {
276 $this->il_pluginslot_by_comp = $il_pluginslot_by_service;
277 }

◆ setIlPluginslotById()

ilCachedComponentData::setIlPluginslotById (   $il_pluginslot_by_id)
Parameters
array$il_pluginslot_by_id

Definition at line 291 of file class.ilCachedComponentData.php.

291 {
292 $this->il_pluginslot_by_id = $il_pluginslot_by_id;
293 }

References $il_pluginslot_by_id.

◆ setIlPluginslotByName()

ilCachedComponentData::setIlPluginslotByName (   $il_pluginslot_by_name)
Parameters
array$il_pluginslot_by_name

Definition at line 307 of file class.ilCachedComponentData.php.

307 {
308 $this->il_pluginslot_by_name = $il_pluginslot_by_name;
309 }

References $il_pluginslot_by_name.

◆ setLoaded()

ilCachedComponentData::setLoaded (   $loaded)
Parameters
boolean$loaded

Definition at line 107 of file class.ilCachedComponentData.php.

107 {
108 $this->loaded = $loaded;
109 }

References $loaded.

◆ setObjDefNameAndTypeRaw()

ilCachedComponentData::setObjDefNameAndTypeRaw (   $obj_def_name_and_type_raw)
Parameters
array$obj_def_name_and_type_raw

Definition at line 195 of file class.ilCachedComponentData.php.

195 {
196 $this->obj_def_name_and_type_raw = $obj_def_name_and_type_raw;
197 }

References $obj_def_name_and_type_raw.

◆ setObjDefNameToId()

ilCachedComponentData::setObjDefNameToId (   $obj_def_name_to_id)
Parameters
array$obj_def_name_to_id

Definition at line 211 of file class.ilCachedComponentData.php.

211 {
212 $this->obj_def_name_to_id = $obj_def_name_to_id;
213 }

References $obj_def_name_to_id.

◆ setSubobjForParent()

ilCachedComponentData::setSubobjForParent (   $subobj_for_parent)
Parameters
array$subobj_for_parent

Definition at line 589 of file class.ilCachedComponentData.php.

589 {
590 $this->subobj_for_parent = $subobj_for_parent;
591 }

References $subobj_for_parent.

Field Documentation

◆ $cached_results

ilCachedComponentData::$cached_results = array()
protected

Definition at line 15 of file class.ilCachedComponentData.php.

Referenced by lookupGroupedRepObj().

◆ $changed

ilCachedComponentData::$changed = false
protected

Definition at line 23 of file class.ilCachedComponentData.php.

◆ $grouped_rep_obj_types

ilCachedComponentData::$grouped_rep_obj_types = array()
protected

Definition at line 55 of file class.ilCachedComponentData.php.

Referenced by getGroupedRepObjTypes(), and setGroupedRepObjTypes().

◆ $il_component

ilCachedComponentData::$il_component = array()
protected

Definition at line 39 of file class.ilCachedComponentData.php.

Referenced by getIlComponent(), and setIlComponent().

◆ $il_object_def

ilCachedComponentData::$il_object_def = array()
protected

Definition at line 43 of file class.ilCachedComponentData.php.

Referenced by getIlObjectDef(), and setIlObjectDef().

◆ $il_object_group

ilCachedComponentData::$il_object_group = array()
protected

Definition at line 75 of file class.ilCachedComponentData.php.

Referenced by getIlObjectGroup(), and setIlObjectGroup().

◆ $il_object_sub_type

ilCachedComponentData::$il_object_sub_type = array()
protected

Definition at line 79 of file class.ilCachedComponentData.php.

Referenced by getIlObjectSubType(), and setIlObjectSubType().

◆ $il_object_subobj

ilCachedComponentData::$il_object_subobj = array()
protected

Definition at line 47 of file class.ilCachedComponentData.php.

Referenced by getIlObjectSubobj(), and setIlObjectSubobj().

◆ $il_plugin_active

ilCachedComponentData::$il_plugin_active = array()
protected

Definition at line 83 of file class.ilCachedComponentData.php.

Referenced by getIlPluginActive(), and setIlPluginActive().

◆ $il_plugin_by_id

ilCachedComponentData::$il_plugin_by_id = array()
protected

Definition at line 71 of file class.ilCachedComponentData.php.

Referenced by getIlPluginById(), and setIlPluginById().

◆ $il_plugin_by_name

ilCachedComponentData::$il_plugin_by_name = array()
protected

Definition at line 87 of file class.ilCachedComponentData.php.

Referenced by getIlPluginByName(), and setIlPluginByName().

◆ $il_pluginslot_by_comp

ilCachedComponentData::$il_pluginslot_by_comp = array()
protected

Definition at line 59 of file class.ilCachedComponentData.php.

Referenced by getIlPluginslotByComp().

◆ $il_pluginslot_by_id

ilCachedComponentData::$il_pluginslot_by_id = array()
protected

Definition at line 63 of file class.ilCachedComponentData.php.

Referenced by getIlPluginslotById(), and setIlPluginslotById().

◆ $il_pluginslot_by_name

ilCachedComponentData::$il_pluginslot_by_name = array()
protected

Definition at line 67 of file class.ilCachedComponentData.php.

Referenced by getIlPluginslotByName(), and setIlPluginslotByName().

◆ $instance

ilCachedComponentData::$instance
staticprotected

Definition at line 19 of file class.ilCachedComponentData.php.

Referenced by getInstance().

◆ $loaded

ilCachedComponentData::$loaded = false
protected

Definition at line 27 of file class.ilCachedComponentData.php.

Referenced by getLoaded(), and setLoaded().

◆ $obj_def_name_and_type_raw

ilCachedComponentData::$obj_def_name_and_type_raw = array()
protected

◆ $obj_def_name_to_id

ilCachedComponentData::$obj_def_name_to_id = array()
protected

Definition at line 31 of file class.ilCachedComponentData.php.

Referenced by getObjDefNameToId(), and setObjDefNameToId().

◆ $subobj_for_parent

ilCachedComponentData::$subobj_for_parent = array()
protected

Definition at line 51 of file class.ilCachedComponentData.php.

Referenced by getSubobjForParent(), and setSubobjForParent().


The documentation for this class was generated from the following file: