ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 541 of file class.ilCachedComponentData.php.

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

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

Member Function Documentation

◆ flush()

static ilCachedComponentData::flush ( )
static

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

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

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

445  {
447  self::$instance = null;
448  }
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 265 of file class.ilCachedComponentData.php.

References $grouped_rep_obj_types.

◆ getIlComponent()

ilCachedComponentData::getIlComponent ( )
Returns
array

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

References $il_component.

◆ getIlObjectDef()

ilCachedComponentData::getIlObjectDef ( )
Returns
array

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

References $il_object_def.

◆ getIlObjectGroup()

ilCachedComponentData::getIlObjectGroup ( )
Returns
array

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

References $il_object_group.

◆ getIlObjectSubobj()

ilCachedComponentData::getIlObjectSubobj ( )
Returns
array

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

References $il_object_subobj.

◆ getIlObjectSubType()

ilCachedComponentData::getIlObjectSubType ( )
Returns
array

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

References $il_object_sub_type.

◆ getIlPluginActive()

ilCachedComponentData::getIlPluginActive ( )
Returns
array

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

References $il_plugin_active.

◆ getIlPluginById()

ilCachedComponentData::getIlPluginById ( )
Returns
array

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

References $il_plugin_by_id.

◆ getIlPluginByName()

ilCachedComponentData::getIlPluginByName ( )
Returns
array

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

References $il_plugin_by_name.

◆ getIlPluginslotByComp()

ilCachedComponentData::getIlPluginslotByComp ( )
Returns
array

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

References $il_pluginslot_by_comp.

◆ getIlPluginslotById()

ilCachedComponentData::getIlPluginslotById ( )
Returns
array

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

References $il_pluginslot_by_id.

◆ getIlPluginslotByName()

ilCachedComponentData::getIlPluginslotByName ( )
Returns
array

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

References $il_pluginslot_by_name.

◆ getInstance()

static ilCachedComponentData::getInstance ( )
static
Returns
ilCachedComponentData

Definition at line 427 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().

428  {
429  if (!isset(self::$instance)) {
431  $cached_obj = $global_cache->get('ilCachedComponentData');
432  if ($cached_obj instanceof ilCachedComponentData) {
433  self::$instance = $cached_obj;
434  } else {
435  self::$instance = new self();
436  $global_cache->set('ilCachedComponentData', self::$instance);
437  }
438  }
439 
440  return self::$instance;
441  }
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 193 of file class.ilCachedComponentData.php.

References $obj_def_name_and_type_raw.

◆ getObjDefNameToId()

ilCachedComponentData::getObjDefNameToId ( )
Returns
array

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

References $obj_def_name_to_id.

◆ getSubobjForParent()

ilCachedComponentData::getSubobjForParent ( )
Returns
array

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

References $subobj_for_parent.

◆ lookCompId()

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

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

References $name, and $type.

516  {
517  return $this->obj_def_name_and_type_raw[$type][$name]['id'];
518  }
$type
if($format !==null) $name
Definition: metadata.php:146

◆ lookupActivePluginsBySlotId()

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

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

References array.

468  {
469  if (is_array($this->il_plugin_active[$slot_id])) {
470  return $this->il_plugin_active[$slot_id];
471  } else {
472  return array();
473  }
474  }
Create styles array
The data for the language used.

◆ lookupCompInfo()

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

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

References $name, and $type.

528  {
529  if (!$type) {
530  if (isset($this->obj_def_name_and_type_raw['Modules'][$name])) {
531  $type = 'Modules';
532  } else {
533  $type = 'Services';
534  }
535  }
536 
537  return $this->obj_def_name_and_type_raw[$type][$name];
538  }
$type
if($format !==null) $name
Definition: metadata.php:146

◆ lookupGroupedRepObj()

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

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

References $index, $s, and array.

557  {
558  if (is_array($parent)) {
559  $index = md5(serialize($parent));
560  if (isset($this->cached_results['grpd_repo'][$index])) {
561  return $this->cached_results['grpd_repo'][$index];
562  }
563 
564  $return = array();
565  $sids = array();
566  foreach ($parent as $p) {
567  $s = $this->grouped_rep_obj_types[$p];
568  foreach ($s as $child) {
569  if (!in_array($child['sid'], $sids)) {
570  $sids[] = $child['sid'];
571  $return[] = $child;
572  }
573  }
574  }
575  $this->changed = true;
576  $this->cached_results['grpd_repo'][$index] = $return;
577 
578  return $return;
579  } else {
580  return $this->grouped_rep_obj_types[$parent];
581  }
582  }
$s
Definition: pwgen.php:45
$index
Definition: metadata.php:60
Create styles array
The data for the language used.

◆ lookupPluginByName()

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

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

References $name.

457  {
458  return $this->il_plugin_by_name[$name];
459  }
if($format !==null) $name
Definition: metadata.php:146

◆ lookupPluginSlotByComponent()

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

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

References array.

591  {
592  if (is_array($this->il_pluginslot_by_comp[$component])) {
593  return $this->il_pluginslot_by_comp[$component];
594  }
595 
596  return array();
597  }
Create styles array
The data for the language used.

◆ lookupPluginSlotById()

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

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

References $id.

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

◆ lookupPluginSlotByName()

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

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

References $name.

617  {
618  return $this->il_pluginslot_by_name[$name];
619  }
if($format !==null) $name
Definition: metadata.php:146

◆ lookupSubObjForParent()

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

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

References $index, and array.

483  {
484  if (is_array($parent)) {
485  $index = md5(serialize($parent));
486  if (isset($this->cached_results['subop_par'][$index])) {
487  return $this->cached_results['subop_par'][$index];
488  }
489 
490  $return = array();
491  foreach ($parent as $p) {
492  if (is_array($this->subobj_for_parent[$p])) {
493  foreach ($this->subobj_for_parent[$p] as $rec) {
494  $return[] = $rec;
495  }
496  }
497  }
498 
499  $this->cached_results['subop_par'][$index] = $return;
500  $this->changed = true;
501 
502  return $return;
503  }
504 
505  return $this->subobj_for_parent[$parent];
506  }
$index
Definition: metadata.php:60
Create styles array
The data for the language used.

◆ setGroupedRepObjTypes()

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

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

References $grouped_rep_obj_types.

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

◆ setIlComponent()

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

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

References $il_component.

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

◆ setIlObjectDef()

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

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

References $il_object_def.

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

◆ setIlObjectGroup()

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

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

References $il_object_group.

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

◆ setIlObjectSubobj()

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

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

References $il_object_subobj.

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

◆ setIlObjectSubType()

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

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

References $il_object_sub_type.

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

◆ setIlPluginActive()

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

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

References $il_plugin_active.

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

◆ setIlPluginById()

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

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

References $il_plugin_by_id.

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

◆ setIlPluginByName()

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

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

References $il_plugin_by_name.

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

◆ setIlPluginslotByComp()

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

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

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

◆ setIlPluginslotById()

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

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

References $il_pluginslot_by_id.

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

◆ setIlPluginslotByName()

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

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

References $il_pluginslot_by_name.

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

◆ setLoaded()

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

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

References $ilDB, $loaded, and array.

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

References $obj_def_name_and_type_raw.

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

◆ setObjDefNameToId()

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

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

References $obj_def_name_to_id.

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

◆ setSubobjForParent()

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

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

References $subobj_for_parent.

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

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: