ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 lookupPluginsBySlotId ($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_slotid = 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 94 of file class.ilCachedComponentData.php.

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

95  {
97  $this->readFromDB();
98  }
static getInstance($component)
+ Here is the call graph for this function:

◆ __destruct()

ilCachedComponentData::__destruct ( )

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

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

557  {
559  if ($this->changed && $ilGlobalCache->isActive()) {
560  $this->changed = false;
561  $ilGlobalCache->set('ilCachedComponentData', $this);
562  }
563  }
static getInstance($component)
+ Here is the call graph for this function:

Member Function Documentation

◆ flush()

static ilCachedComponentData::flush ( )
static

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

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

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

451  {
453  self::$instance = null;
454  }
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 271 of file class.ilCachedComponentData.php.

References $grouped_rep_obj_types.

◆ getIlComponent()

ilCachedComponentData::getIlComponent ( )
Returns
array

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

References $il_component.

◆ getIlObjectDef()

ilCachedComponentData::getIlObjectDef ( )
Returns
array

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

References $il_object_def.

◆ getIlObjectGroup()

ilCachedComponentData::getIlObjectGroup ( )
Returns
array

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

References $il_object_group.

◆ getIlObjectSubobj()

ilCachedComponentData::getIlObjectSubobj ( )
Returns
array

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

References $il_object_subobj.

◆ getIlObjectSubType()

ilCachedComponentData::getIlObjectSubType ( )
Returns
array

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

References $il_object_sub_type.

◆ getIlPluginActive()

ilCachedComponentData::getIlPluginActive ( )
Returns
array

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

References $il_plugin_active.

◆ getIlPluginById()

ilCachedComponentData::getIlPluginById ( )
Returns
array

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

References $il_plugin_by_id.

◆ getIlPluginByName()

ilCachedComponentData::getIlPluginByName ( )
Returns
array

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

References $il_plugin_by_name.

◆ getIlPluginslotByComp()

ilCachedComponentData::getIlPluginslotByComp ( )
Returns
array

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

References $il_pluginslot_by_comp.

◆ getIlPluginslotById()

ilCachedComponentData::getIlPluginslotById ( )
Returns
array

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

References $il_pluginslot_by_id.

◆ getIlPluginslotByName()

ilCachedComponentData::getIlPluginslotByName ( )
Returns
array

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

References $il_pluginslot_by_name.

◆ getInstance()

static ilCachedComponentData::getInstance ( )
static
Returns
ilCachedComponentData

Definition at line 433 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(), ilPluginSlot\getAvailableSlots(), ilComponent\getComponentInfo(), ilObjectDefinition\getGroupedRepositoryObjectTypes(), ilPlugin\getPluginObject(), ilPlugin\getPluginRecord(), ilPluginAdmin\isPluginActive(), ilComponent\lookupId(), ilComponent\lookupPluginSlots(), ilPluginSlot\lookupSlotId(), ilPluginSlot\lookupSlotName(), ilPluginSlot\read(), and ilObjectDefinition\readDefinitionDataFromCache().

434  {
435  if (!isset(self::$instance)) {
437  $cached_obj = $global_cache->get('ilCachedComponentData');
438  if ($cached_obj instanceof ilCachedComponentData) {
439  self::$instance = $cached_obj;
440  } else {
441  self::$instance = new self();
442  $global_cache->set('ilCachedComponentData', self::$instance);
443  }
444  }
445 
446  return self::$instance;
447  }
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 104 of file class.ilCachedComponentData.php.

References $loaded.

105  {
106  return $this->loaded;
107  }

◆ getObjDefNameAndTypeRaw()

ilCachedComponentData::getObjDefNameAndTypeRaw ( )
Returns
array

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

References $obj_def_name_and_type_raw.

◆ getObjDefNameToId()

ilCachedComponentData::getObjDefNameToId ( )
Returns
array

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

References $obj_def_name_to_id.

◆ getSubobjForParent()

ilCachedComponentData::getSubobjForParent ( )
Returns
array

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

References $subobj_for_parent.

◆ lookCompId()

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

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

References $name, and $type.

531  {
532  return $this->obj_def_name_and_type_raw[$type][$name]['id'];
533  }
$type
if($format !==null) $name
Definition: metadata.php:230

◆ lookupActivePluginsBySlotId()

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

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

474  {
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];
477  } else {
478  return array();
479  }
480  }

◆ lookupCompInfo()

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

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

References $name, and $type.

543  {
544  if (!$type) {
545  if (isset($this->obj_def_name_and_type_raw['Modules'][$name])) {
546  $type = 'Modules';
547  } else {
548  $type = 'Services';
549  }
550  }
551 
552  return $this->obj_def_name_and_type_raw[$type][$name];
553  }
$type
if($format !==null) $name
Definition: metadata.php:230

◆ lookupGroupedRepObj()

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

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

References $index.

572  {
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];
577  }
578 
579  $return = array();
580  $sids = array();
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'];
586  $return[] = $child;
587  }
588  }
589  }
590  $this->changed = true;
591  $this->cached_results['grpd_repo'][$index] = $return;
592 
593  return $return;
594  } else {
595  return $this->grouped_rep_obj_types[$parent];
596  }
597  }
$index
Definition: metadata.php:128

◆ lookupPluginByName()

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

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

References $name.

463  {
464  return $this->il_plugin_by_name[$name];
465  }
if($format !==null) $name
Definition: metadata.php:230

◆ lookupPluginsBySlotId()

ilCachedComponentData::lookupPluginsBySlotId (   $slot_id)
Parameters
$slot_id
Returns
array

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

488  {
489  return $this->il_plugin_by_slotid[$slot_id];
490  }

◆ lookupPluginSlotByComponent()

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

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

606  {
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];
609  }
610 
611  return array();
612  }

◆ lookupPluginSlotById()

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

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

621  {
622  return $this->il_pluginslot_by_id[$id];
623  }

◆ lookupPluginSlotByName()

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

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

References $name.

632  {
633  return $this->il_pluginslot_by_name[$name];
634  }
if($format !==null) $name
Definition: metadata.php:230

◆ lookupSubObjForParent()

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

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

References $index.

498  {
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];
503  }
504 
505  $return = array();
506  foreach ($parent as $p) {
507  if (is_array($this->subobj_for_parent[$p])) {
508  foreach ($this->subobj_for_parent[$p] as $rec) {
509  $return[] = $rec;
510  }
511  }
512  }
513 
514  $this->cached_results['subop_par'][$index] = $return;
515  $this->changed = true;
516 
517  return $return;
518  }
519 
520  return $this->subobj_for_parent[$parent];
521  }
$index
Definition: metadata.php:128

◆ setGroupedRepObjTypes()

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

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

References $grouped_rep_obj_types.

281  {
282  $this->grouped_rep_obj_types = $grouped_rep_obj_types;
283  }

◆ setIlComponent()

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

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

References $il_component.

191  {
192  $this->il_component = $il_component;
193  }

◆ setIlObjectDef()

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

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

References $il_object_def.

245  {
246  $this->il_object_def = $il_object_def;
247  }

◆ setIlObjectGroup()

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

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

References $il_object_group.

407  {
408  $this->il_object_group = $il_object_group;
409  }

◆ setIlObjectSubobj()

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

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

References $il_object_subobj.

263  {
264  $this->il_object_subobj = $il_object_subobj;
265  }

◆ setIlObjectSubType()

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

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

References $il_object_sub_type.

425  {
426  $this->il_object_sub_type = $il_object_sub_type;
427  }

◆ setIlPluginActive()

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

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

References $il_plugin_active.

389  {
390  $this->il_plugin_active = $il_plugin_active;
391  }

◆ setIlPluginById()

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

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

References $il_plugin_by_id.

353  {
354  $this->il_plugin_by_id = $il_plugin_by_id;
355  }

◆ setIlPluginByName()

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

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

References $il_plugin_by_name.

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

◆ setIlPluginslotByComp()

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

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

299  {
300  $this->il_pluginslot_by_comp = $il_pluginslot_by_service;
301  }

◆ setIlPluginslotById()

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

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

References $il_pluginslot_by_id.

317  {
318  $this->il_pluginslot_by_id = $il_pluginslot_by_id;
319  }

◆ setIlPluginslotByName()

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

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

References $il_pluginslot_by_name.

335  {
336  $this->il_pluginslot_by_name = $il_pluginslot_by_name;
337  }

◆ setLoaded()

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

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

References $DIC, $ilDB, and $loaded.

114  {
115  $this->loaded = $loaded;
116  }

◆ setObjDefNameAndTypeRaw()

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

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

References $obj_def_name_and_type_raw.

209  {
210  $this->obj_def_name_and_type_raw = $obj_def_name_and_type_raw;
211  }

◆ setObjDefNameToId()

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

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

References $obj_def_name_to_id.

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

◆ setSubobjForParent()

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

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

References $subobj_for_parent.

650  {
651  $this->subobj_for_parent = $subobj_for_parent;
652  }

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 91 of file class.ilCachedComponentData.php.

Referenced by getIlPluginByName(), and setIlPluginByName().

◆ $il_plugin_by_slotid

ilCachedComponentData::$il_plugin_by_slotid = array()
protected

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

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