ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 9 of file class.ilCachedComponentData.php.

Constructor & Destructor Documentation

◆ __construct()

ilCachedComponentData::__construct ( )
protected

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

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

91  {
93  $this->readFromDB();
94  }
static getInstance($component)
+ Here is the call graph for this function:

◆ __destruct()

ilCachedComponentData::__destruct ( )

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

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

543  {
545  if ($this->changed && $ilGlobalCache->isActive()) {
546  $this->changed = false;
547  $ilGlobalCache->set('ilCachedComponentData', $this);
548  }
549  }
static getInstance($component)
+ Here is the call graph for this function:

Member Function Documentation

◆ flush()

static ilCachedComponentData::flush ( )
static

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

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

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

446  {
448  self::$instance = null;
449  }
static getInstance($component)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupedRepObjTypes()

ilCachedComponentData::getGroupedRepObjTypes ( )
Returns
array

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

References $grouped_rep_obj_types.

◆ getIlComponent()

ilCachedComponentData::getIlComponent ( )
Returns
array

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

References $il_component.

◆ getIlObjectDef()

ilCachedComponentData::getIlObjectDef ( )
Returns
array

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

References $il_object_def.

◆ getIlObjectGroup()

ilCachedComponentData::getIlObjectGroup ( )
Returns
array

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

References $il_object_group.

◆ getIlObjectSubobj()

ilCachedComponentData::getIlObjectSubobj ( )
Returns
array

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

References $il_object_subobj.

◆ getIlObjectSubType()

ilCachedComponentData::getIlObjectSubType ( )
Returns
array

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

References $il_object_sub_type.

◆ getIlPluginActive()

ilCachedComponentData::getIlPluginActive ( )
Returns
array

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

References $il_plugin_active.

◆ getIlPluginById()

ilCachedComponentData::getIlPluginById ( )
Returns
array

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

References $il_plugin_by_id.

◆ getIlPluginByName()

ilCachedComponentData::getIlPluginByName ( )
Returns
array

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

References $il_plugin_by_name.

◆ getIlPluginslotByComp()

ilCachedComponentData::getIlPluginslotByComp ( )
Returns
array

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

References $il_pluginslot_by_comp.

◆ getIlPluginslotById()

ilCachedComponentData::getIlPluginslotById ( )
Returns
array

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

References $il_pluginslot_by_id.

◆ getIlPluginslotByName()

ilCachedComponentData::getIlPluginslotByName ( )
Returns
array

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

References $il_pluginslot_by_name.

◆ getInstance()

static ilCachedComponentData::getInstance ( )
static
Returns
ilCachedComponentData

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

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

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

429  {
430  if (!isset(self::$instance)) {
432  $cached_obj = $global_cache->get('ilCachedComponentData');
433  if ($cached_obj instanceof ilCachedComponentData) {
434  self::$instance = $cached_obj;
435  } else {
436  self::$instance = new self();
437  $global_cache->set('ilCachedComponentData', self::$instance);
438  }
439  }
440 
441  return self::$instance;
442  }
static getInstance($component)
Class ilCachedComponentData.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLoaded()

ilCachedComponentData::getLoaded ( )
Returns
boolean

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

References $loaded.

101  {
102  return $this->loaded;
103  }

◆ getObjDefNameAndTypeRaw()

ilCachedComponentData::getObjDefNameAndTypeRaw ( )
Returns
array

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

References $obj_def_name_and_type_raw.

◆ getObjDefNameToId()

ilCachedComponentData::getObjDefNameToId ( )
Returns
array

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

References $obj_def_name_to_id.

◆ getSubobjForParent()

ilCachedComponentData::getSubobjForParent ( )
Returns
array

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

References $subobj_for_parent.

◆ lookCompId()

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

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

References $name, and $type.

517  {
518  return $this->obj_def_name_and_type_raw[$type][$name]['id'];
519  }
$type

◆ lookupActivePluginsBySlotId()

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

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

469  {
470  if (is_array($this->il_plugin_active[$slot_id])) {
471  return $this->il_plugin_active[$slot_id];
472  } else {
473  return array();
474  }
475  }

◆ lookupCompInfo()

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

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

References $name, and $type.

529  {
530  if (!$type) {
531  if (isset($this->obj_def_name_and_type_raw['Modules'][$name])) {
532  $type = 'Modules';
533  } else {
534  $type = 'Services';
535  }
536  }
537 
538  return $this->obj_def_name_and_type_raw[$type][$name];
539  }
$type

◆ lookupGroupedRepObj()

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

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

References $index, and $s.

558  {
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];
563  }
564 
565  $return = array();
566  $sids = array();
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'];
572  $return[] = $child;
573  }
574  }
575  }
576  $this->changed = true;
577  $this->cached_results['grpd_repo'][$index] = $return;
578 
579  return $return;
580  } else {
581  return $this->grouped_rep_obj_types[$parent];
582  }
583  }
$s
Definition: pwgen.php:45
$index
Definition: metadata.php:60

◆ lookupPluginByName()

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

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

References $name.

458  {
459  return $this->il_plugin_by_name[$name];
460  }

◆ lookupPluginSlotByComponent()

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

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

592  {
593  if (is_array($this->il_pluginslot_by_comp[$component])) {
594  return $this->il_pluginslot_by_comp[$component];
595  }
596 
597  return array();
598  }

◆ lookupPluginSlotById()

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

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

References $id.

607  {
608  return $this->il_pluginslot_by_id[$id];
609  }
if(!array_key_exists('StateId', $_REQUEST)) $id

◆ lookupPluginSlotByName()

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

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

References $name.

618  {
619  return $this->il_pluginslot_by_name[$name];
620  }

◆ lookupSubObjForParent()

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

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

References $index.

484  {
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];
489  }
490 
491  $return = array();
492  foreach ($parent as $p) {
493  if (is_array($this->subobj_for_parent[$p])) {
494  foreach ($this->subobj_for_parent[$p] as $rec) {
495  $return[] = $rec;
496  }
497  }
498  }
499 
500  $this->cached_results['subop_par'][$index] = $return;
501  $this->changed = true;
502 
503  return $return;
504  }
505 
506  return $this->subobj_for_parent[$parent];
507  }
$index
Definition: metadata.php:60

◆ setGroupedRepObjTypes()

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

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

References $grouped_rep_obj_types.

276  {
277  $this->grouped_rep_obj_types = $grouped_rep_obj_types;
278  }

◆ setIlComponent()

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

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

References $il_component.

186  {
187  $this->il_component = $il_component;
188  }

◆ setIlObjectDef()

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

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

References $il_object_def.

240  {
241  $this->il_object_def = $il_object_def;
242  }

◆ setIlObjectGroup()

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

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

References $il_object_group.

402  {
403  $this->il_object_group = $il_object_group;
404  }

◆ setIlObjectSubobj()

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

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

References $il_object_subobj.

258  {
259  $this->il_object_subobj = $il_object_subobj;
260  }

◆ setIlObjectSubType()

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

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

References $il_object_sub_type.

420  {
421  $this->il_object_sub_type = $il_object_sub_type;
422  }

◆ setIlPluginActive()

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

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

References $il_plugin_active.

384  {
385  $this->il_plugin_active = $il_plugin_active;
386  }

◆ setIlPluginById()

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

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

References $il_plugin_by_id.

348  {
349  $this->il_plugin_by_id = $il_plugin_by_id;
350  }

◆ setIlPluginByName()

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

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

References $il_plugin_by_name.

366  {
367  $this->il_plugin_by_name = $il_plugin_by_name;
368  }

◆ setIlPluginslotByComp()

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

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

294  {
295  $this->il_pluginslot_by_comp = $il_pluginslot_by_service;
296  }

◆ setIlPluginslotById()

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

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

References $il_pluginslot_by_id.

312  {
313  $this->il_pluginslot_by_id = $il_pluginslot_by_id;
314  }

◆ setIlPluginslotByName()

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

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

References $il_pluginslot_by_name.

330  {
331  $this->il_pluginslot_by_name = $il_pluginslot_by_name;
332  }

◆ setLoaded()

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

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

References $DIC, $ilDB, and $loaded.

110  {
111  $this->loaded = $loaded;
112  }

◆ setObjDefNameAndTypeRaw()

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

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

References $obj_def_name_and_type_raw.

204  {
205  $this->obj_def_name_and_type_raw = $obj_def_name_and_type_raw;
206  }

◆ setObjDefNameToId()

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

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

References $obj_def_name_to_id.

222  {
223  $this->obj_def_name_to_id = $obj_def_name_to_id;
224  }

◆ setSubobjForParent()

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

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

References $subobj_for_parent.

636  {
637  $this->subobj_for_parent = $subobj_for_parent;
638  }

Field Documentation

◆ $cached_results

ilCachedComponentData::$cached_results = array()
protected

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

◆ $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.

◆ $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: