ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 89 of file class.ilCachedComponentData.php.

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

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

◆ __destruct()

ilCachedComponentData::__destruct ( )

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

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

501  {
503  if ($this->changed && $ilGlobalCache->isActive()) {
504  $this->changed = false;
505  $ilGlobalCache->set('ilCachedComponentData', $this);
506  }
507  }
static getInstance($component)
+ Here is the call graph for this function:

Member Function Documentation

◆ flush()

static ilCachedComponentData::flush ( )
static

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

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

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

410  {
412  self::$instance = null;
413  }
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 250 of file class.ilCachedComponentData.php.

References $grouped_rep_obj_types.

◆ getIlComponent()

ilCachedComponentData::getIlComponent ( )
Returns
array

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

References $il_component.

◆ getIlObjectDef()

ilCachedComponentData::getIlObjectDef ( )
Returns
array

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

References $il_object_def.

◆ getIlObjectGroup()

ilCachedComponentData::getIlObjectGroup ( )
Returns
array

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

References $il_object_group.

◆ getIlObjectSubobj()

ilCachedComponentData::getIlObjectSubobj ( )
Returns
array

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

References $il_object_subobj.

◆ getIlObjectSubType()

ilCachedComponentData::getIlObjectSubType ( )
Returns
array

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

References $il_object_sub_type.

◆ getIlPluginActive()

ilCachedComponentData::getIlPluginActive ( )
Returns
array

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

References $il_plugin_active.

◆ getIlPluginById()

ilCachedComponentData::getIlPluginById ( )
Returns
array

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

References $il_plugin_by_id.

◆ getIlPluginByName()

ilCachedComponentData::getIlPluginByName ( )
Returns
array

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

References $il_plugin_by_name.

◆ getIlPluginslotByComp()

ilCachedComponentData::getIlPluginslotByComp ( )
Returns
array

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

References $il_pluginslot_by_comp.

◆ getIlPluginslotById()

ilCachedComponentData::getIlPluginslotById ( )
Returns
array

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

References $il_pluginslot_by_id.

◆ getIlPluginslotByName()

ilCachedComponentData::getIlPluginslotByName ( )
Returns
array

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

References $il_pluginslot_by_name.

◆ getInstance()

static ilCachedComponentData::getInstance ( )
static
Returns
ilCachedComponentData

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

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

Referenced by ilComponent\__construct(), ilPlugin\getActivePluginIdsForSlot(), 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().

394  {
395  if (!isset(self::$instance)) {
397  $cached_obj = $global_cache->get('ilCachedComponentData');
398  if ($cached_obj instanceof ilCachedComponentData) {
399  self::$instance = $cached_obj;
400  } else {
401  self::$instance = new self();
402  $global_cache->set('ilCachedComponentData', self::$instance);
403  }
404  }
405 
406  return self::$instance;
407  }
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 98 of file class.ilCachedComponentData.php.

References $loaded.

◆ getObjDefNameAndTypeRaw()

ilCachedComponentData::getObjDefNameAndTypeRaw ( )
Returns
array

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

References $obj_def_name_and_type_raw.

◆ getObjDefNameToId()

ilCachedComponentData::getObjDefNameToId ( )
Returns
array

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

References $obj_def_name_to_id.

◆ getSubobjForParent()

ilCachedComponentData::getSubobjForParent ( )
Returns
array

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

References $subobj_for_parent.

◆ lookCompId()

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

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

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

◆ lookupActivePluginsBySlotId()

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

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

References array.

431  {
432  if (is_array($this->il_plugin_active[$slot_id])) {
433  return $this->il_plugin_active[$slot_id];
434  } else {
435  return array();
436  }
437  }
Create styles array
The data for the language used.

◆ lookupCompInfo()

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

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

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

◆ lookupGroupedRepObj()

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

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

References array.

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

◆ lookupPluginByName()

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

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

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

◆ lookupPluginSlotByComponent()

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

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

References array.

548  {
549  if (is_array($this->il_pluginslot_by_comp[$component])) {
550  return $this->il_pluginslot_by_comp[$component];
551  }
552 
553  return array();
554  }
Create styles array
The data for the language used.

◆ lookupPluginSlotById()

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

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

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

◆ lookupPluginSlotByName()

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

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

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

◆ lookupSubObjForParent()

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

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

References array.

445  {
446  if (is_array($parent)) {
447  $index = md5(serialize($parent));
448  if (isset($this->cached_results['subop_par'][$index])) {
449  return $this->cached_results['subop_par'][$index];
450  }
451 
452  $return = array();
453  foreach ($parent as $p) {
454  if (is_array($this->subobj_for_parent[$p])) {
455  foreach ($this->subobj_for_parent[$p] as $rec) {
456  $return[] = $rec;
457  }
458  }
459  }
460 
461  $this->cached_results['subop_par'][$index] = $return;
462  $this->changed = true;
463 
464  return $return;
465  }
466 
467  return $this->subobj_for_parent[$parent];
468  }
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 258 of file class.ilCachedComponentData.php.

References $grouped_rep_obj_types.

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

◆ setIlComponent()

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

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

References $il_component.

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

◆ setIlObjectDef()

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

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

References $il_object_def.

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

◆ setIlObjectGroup()

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

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

References $il_object_group.

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

◆ setIlObjectSubobj()

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

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

References $il_object_subobj.

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

◆ setIlObjectSubType()

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

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

References $il_object_sub_type.

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

◆ setIlPluginActive()

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

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

References $il_plugin_active.

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

◆ setIlPluginById()

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

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

References $il_plugin_by_id.

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

◆ setIlPluginByName()

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

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

References $il_plugin_by_name.

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

◆ setIlPluginslotByComp()

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

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

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

◆ setIlPluginslotById()

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

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

References $il_pluginslot_by_id.

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

◆ setIlPluginslotByName()

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

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

References $il_pluginslot_by_name.

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

◆ setLoaded()

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

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

References $ilDB, $loaded, and array.

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

◆ setObjDefNameAndTypeRaw()

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

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

References $obj_def_name_and_type_raw.

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

◆ setObjDefNameToId()

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

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

References $obj_def_name_to_id.

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

◆ setSubobjForParent()

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

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

References $subobj_for_parent.

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

Field Documentation

◆ $cached_results

ilCachedComponentData::$cached_results = array()
protected

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

◆ $changed

ilCachedComponentData::$changed = false
protected

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

◆ $grouped_rep_obj_types

ilCachedComponentData::$grouped_rep_obj_types = array()
protected

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

Referenced by getGroupedRepObjTypes(), and setGroupedRepObjTypes().

◆ $il_component

ilCachedComponentData::$il_component = array()
protected

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

Referenced by getIlComponent(), and setIlComponent().

◆ $il_object_def

ilCachedComponentData::$il_object_def = array()
protected

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

Referenced by getIlObjectDef(), and setIlObjectDef().

◆ $il_object_group

ilCachedComponentData::$il_object_group = array()
protected

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

Referenced by getIlObjectGroup(), and setIlObjectGroup().

◆ $il_object_sub_type

ilCachedComponentData::$il_object_sub_type = array()
protected

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

Referenced by getIlObjectSubType(), and setIlObjectSubType().

◆ $il_object_subobj

ilCachedComponentData::$il_object_subobj = array()
protected

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

Referenced by getIlObjectSubobj(), and setIlObjectSubobj().

◆ $il_plugin_active

ilCachedComponentData::$il_plugin_active = array()
protected

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

Referenced by getIlPluginActive(), and setIlPluginActive().

◆ $il_plugin_by_id

ilCachedComponentData::$il_plugin_by_id = array()
protected

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

Referenced by getIlPluginById(), and setIlPluginById().

◆ $il_plugin_by_name

ilCachedComponentData::$il_plugin_by_name = array()
protected

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

Referenced by getIlPluginByName(), and setIlPluginByName().

◆ $il_pluginslot_by_comp

ilCachedComponentData::$il_pluginslot_by_comp = array()
protected

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

Referenced by getIlPluginslotByComp().

◆ $il_pluginslot_by_id

ilCachedComponentData::$il_pluginslot_by_id = array()
protected

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

Referenced by getIlPluginslotById(), and setIlPluginslotById().

◆ $il_pluginslot_by_name

ilCachedComponentData::$il_pluginslot_by_name = array()
protected

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

Referenced by getIlPluginslotByName(), and setIlPluginslotByName().

◆ $instance

ilCachedComponentData::$instance
staticprotected

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

◆ $loaded

ilCachedComponentData::$loaded = false
protected

Definition at line 26 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 30 of file class.ilCachedComponentData.php.

Referenced by getObjDefNameToId(), and setObjDefNameToId().

◆ $subobj_for_parent

ilCachedComponentData::$subobj_for_parent = array()
protected

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

Referenced by getSubobjForParent(), and setSubobjForParent().


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