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.

89 {
91 $this->readFromDB();
92 }
static getInstance($component)

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

+ Here is the call graph for this function:

◆ __destruct()

ilCachedComponentData::__destruct ( )

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

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

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

410 {
412 self::$instance = null;
413 }

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

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 }
Class ilCachedComponentData.

References $instance, 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().

+ 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.

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 }

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

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 }

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

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 }

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

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 }

◆ setGroupedRepObjTypes()

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

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

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

References $grouped_rep_obj_types.

◆ setIlComponent()

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

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

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

References $il_component.

◆ setIlObjectDef()

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

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

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

References $il_object_def.

◆ setIlObjectGroup()

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

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

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

References $il_object_group.

◆ setIlObjectSubobj()

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

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

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

References $il_object_subobj.

◆ setIlObjectSubType()

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

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

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

References $il_object_sub_type.

◆ setIlPluginActive()

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

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

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

References $il_plugin_active.

◆ setIlPluginById()

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

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

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

References $il_plugin_by_id.

◆ setIlPluginByName()

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

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

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

References $il_plugin_by_name.

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

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

References $il_pluginslot_by_id.

◆ setIlPluginslotByName()

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

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

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

References $il_pluginslot_by_name.

◆ setLoaded()

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

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

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

References $loaded.

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

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

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

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

References $obj_def_name_to_id.

◆ setSubobjForParent()

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

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

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

References $subobj_for_parent.

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.

Referenced by getInstance().

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