ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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)
 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 10 of file class.ilCachedComponentData.php.

Constructor & Destructor Documentation

ilCachedComponentData::__construct ( )
protected

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

References ilGlobalCache\COMP_COMPONENT, and getInstance().

{
$this->readFromDB();
}

+ Here is the call graph for this function:

ilCachedComponentData::__destruct ( )

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

References ilGlobalCache\COMP_COMPONENT, and getInstance().

{
if ($this->changed && $ilGlobalCache->isActive()) {
$this->changed = false;
$ilGlobalCache->set('ilCachedComponentData', $this);
}
}

+ Here is the call graph for this function:

Member Function Documentation

static ilCachedComponentData::flush ( )
static

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

References ilGlobalCache\COMP_COMPONENT, and getInstance().

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

{
self::$instance = NULL;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCachedComponentData::getGroupedRepObjTypes ( )
Returns
array

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

References $grouped_rep_obj_types.

ilCachedComponentData::getIlComponent ( )
Returns
array

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

References $il_component.

{
}
ilCachedComponentData::getIlObjectDef ( )
Returns
array

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

References $il_object_def.

{
}
ilCachedComponentData::getIlObjectGroup ( )
Returns
array

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

References $il_object_group.

ilCachedComponentData::getIlObjectSubobj ( )
Returns
array

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

References $il_object_subobj.

ilCachedComponentData::getIlObjectSubType ( )
Returns
array

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

References $il_object_sub_type.

ilCachedComponentData::getIlPluginActive ( )
Returns
array

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

References $il_plugin_active.

ilCachedComponentData::getIlPluginById ( )
Returns
array

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

References $il_plugin_by_id.

ilCachedComponentData::getIlPluginByName ( )
Returns
array

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

References $il_plugin_by_name.

ilCachedComponentData::getIlPluginslotByComp ( )
Returns
array

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

References $il_pluginslot_by_comp.

ilCachedComponentData::getIlPluginslotById ( )
Returns
array

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

References $il_pluginslot_by_id.

ilCachedComponentData::getIlPluginslotByName ( )
Returns
array

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

References $il_pluginslot_by_name.

static ilCachedComponentData::getInstance ( )
static
Returns
ilCachedComponentData

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

References $instance, and ilGlobalCache\COMP_COMPONENT.

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

{
if (!isset(self::$instance)) {
$cached_obj = $global_cache->get('ilCachedComponentData');
if ($cached_obj instanceof ilCachedComponentData) {
self::$instance = $cached_obj;
} else {
self::$instance = new self();
$global_cache->set('ilCachedComponentData', self::$instance);
}
}
}

+ Here is the caller graph for this function:

ilCachedComponentData::getLoaded ( )
Returns
boolean

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

References $loaded.

{
return $this->loaded;
}
ilCachedComponentData::getObjDefNameAndTypeRaw ( )
Returns
array

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

References $obj_def_name_and_type_raw.

ilCachedComponentData::getObjDefNameToId ( )
Returns
array

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

References $obj_def_name_to_id.

ilCachedComponentData::getSubobjForParent ( )
Returns
array

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

References $subobj_for_parent.

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

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

{
return $this->obj_def_name_and_type_raw[$type][$name]['id'];
}
ilCachedComponentData::lookupActivePluginsBySlotId (   $slot_id)
Parameters
$slot_id
Returns
mixed

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

{
if (is_array($this->il_plugin_active[$slot_id])) {
return $this->il_plugin_active[$slot_id];
} else {
return array();
}
}
ilCachedComponentData::lookupCompInfo (   $type,
  $name 
)
Parameters
$name
$type
Returns
mixed

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

{
if (!$type) {
if (isset($this->obj_def_name_and_type_raw['Modules'][$name])) {
$type = 'Modules';
} else {
$type = 'Services';
}
}
return $this->obj_def_name_and_type_raw[$type][$name];
}
ilCachedComponentData::lookupGroupedRepObj (   $parent)
Parameters
$parent
Returns
mixed

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

References $cached_results.

{
if (is_array($parent)) {
$index = md5(serialize($parent));
if (isset($cached_results['grpd_repo'][$index])) {
return $cached_results['grpd_repo'][$index];
}
$return = array();
$sids = array();
foreach ($parent as $p) {
$s = $this->grouped_rep_obj_types[$p];
foreach ($s as $child) {
if (!in_array($child['sid'], $sids)) {
$sids[] = $child['sid'];
$return[] = $child;
}
}
}
$this->changed = true;
$this->cached_results['grpd_repo'][$index] = $return;
return $return;
} else {
return $this->grouped_rep_obj_types[$parent];
}
}
ilCachedComponentData::lookupPluginByName (   $name)
Parameters
$name
Returns
mixed

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

{
return $this->il_plugin_by_name[$name];
}
ilCachedComponentData::lookupPluginSlotByComponent (   $component)
Parameters
$component
Returns
mixed

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

{
if (is_array($this->il_pluginslot_by_comp[$component])) {
return $this->il_pluginslot_by_comp[$component];
}
return array();
}
ilCachedComponentData::lookupPluginSlotById (   $id)
Parameters
$id
Returns
mixed

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

{
return $this->il_pluginslot_by_id[$id];
}
ilCachedComponentData::lookupPluginSlotByName (   $name)
Parameters
$name
Returns
mixed

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

{
return $this->il_pluginslot_by_name[$name];
}
ilCachedComponentData::lookupSubObjForParent (   $parent)
Parameters
$parent
Returns
mixed

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

{
if (is_array($parent)) {
$index = md5(serialize($parent));
if (isset($this->cached_results['subop_par'][$index])) {
return $this->cached_results['subop_par'][$index];
}
$return = array();
foreach ($parent as $p) {
if (is_array($this->subobj_for_parent[$p])) {
foreach ($this->subobj_for_parent[$p] as $rec) {
$return[] = $rec;
}
}
}
$this->cached_results['subop_par'][$index] = $return;
$this->changed = true;
return $return;
}
return $this->subobj_for_parent[$parent];
}
ilCachedComponentData::setGroupedRepObjTypes (   $grouped_rep_obj_types)
Parameters
array$grouped_rep_obj_types

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

References $grouped_rep_obj_types.

{
$this->grouped_rep_obj_types = $grouped_rep_obj_types;
}
ilCachedComponentData::setIlComponent (   $il_component)
Parameters
array$il_component

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

References $il_component.

{
$this->il_component = $il_component;
}
ilCachedComponentData::setIlObjectDef (   $il_object_def)
Parameters
array$il_object_def

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

References $il_object_def.

{
$this->il_object_def = $il_object_def;
}
ilCachedComponentData::setIlObjectGroup (   $il_object_group)
Parameters
array$il_object_group

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

References $il_object_group.

{
$this->il_object_group = $il_object_group;
}
ilCachedComponentData::setIlObjectSubobj (   $il_object_subobj)
Parameters
array$il_object_subobj

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

References $il_object_subobj.

{
$this->il_object_subobj = $il_object_subobj;
}
ilCachedComponentData::setIlObjectSubType (   $il_object_sub_type)
Parameters
array$il_object_sub_type

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

References $il_object_sub_type.

{
$this->il_object_sub_type = $il_object_sub_type;
}
ilCachedComponentData::setIlPluginActive (   $il_plugin_active)
Parameters
array$il_plugin_active

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

References $il_plugin_active.

{
$this->il_plugin_active = $il_plugin_active;
}
ilCachedComponentData::setIlPluginById (   $il_plugin_by_id)
Parameters
array$il_plugin_by_id

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

References $il_plugin_by_id.

{
$this->il_plugin_by_id = $il_plugin_by_id;
}
ilCachedComponentData::setIlPluginByName (   $il_plugin_by_name)
Parameters
array$il_plugin_by_name

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

References $il_plugin_by_name.

{
$this->il_plugin_by_name = $il_plugin_by_name;
}
ilCachedComponentData::setIlPluginslotByComp (   $il_pluginslot_by_service)
Parameters
array$il_pluginslot_by_service

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

{
$this->il_pluginslot_by_comp = $il_pluginslot_by_service;
}
ilCachedComponentData::setIlPluginslotById (   $il_pluginslot_by_id)
Parameters
array$il_pluginslot_by_id

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

References $il_pluginslot_by_id.

{
$this->il_pluginslot_by_id = $il_pluginslot_by_id;
}
ilCachedComponentData::setIlPluginslotByName (   $il_pluginslot_by_name)
Parameters
array$il_pluginslot_by_name

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

References $il_pluginslot_by_name.

{
$this->il_pluginslot_by_name = $il_pluginslot_by_name;
}
ilCachedComponentData::setLoaded (   $loaded)
Parameters
boolean$loaded

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

References $loaded.

{
$this->loaded = $loaded;
}
ilCachedComponentData::setObjDefNameAndTypeRaw (   $obj_def_name_and_type_raw)
Parameters
array$obj_def_name_and_type_raw

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

References $obj_def_name_and_type_raw.

{
$this->obj_def_name_and_type_raw = $obj_def_name_and_type_raw;
}
ilCachedComponentData::setObjDefNameToId (   $obj_def_name_to_id)
Parameters
array$obj_def_name_to_id

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

References $obj_def_name_to_id.

{
$this->obj_def_name_to_id = $obj_def_name_to_id;
}
ilCachedComponentData::setSubobjForParent (   $subobj_for_parent)
Parameters
array$subobj_for_parent

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

References $subobj_for_parent.

{
$this->subobj_for_parent = $subobj_for_parent;
}

Field Documentation

ilCachedComponentData::$cached_results = array()
protected

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

Referenced by lookupGroupedRepObj().

ilCachedComponentData::$changed = false
protected

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

ilCachedComponentData::$grouped_rep_obj_types = array()
protected

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

Referenced by getGroupedRepObjTypes(), and setGroupedRepObjTypes().

ilCachedComponentData::$il_component = array()
protected

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

Referenced by getIlComponent(), and setIlComponent().

ilCachedComponentData::$il_object_def = array()
protected

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

Referenced by getIlObjectDef(), and setIlObjectDef().

ilCachedComponentData::$il_object_group = array()
protected

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

Referenced by getIlObjectGroup(), and setIlObjectGroup().

ilCachedComponentData::$il_object_sub_type = array()
protected

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

Referenced by getIlObjectSubType(), and setIlObjectSubType().

ilCachedComponentData::$il_object_subobj = array()
protected

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

Referenced by getIlObjectSubobj(), and setIlObjectSubobj().

ilCachedComponentData::$il_plugin_active = array()
protected

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

Referenced by getIlPluginActive(), and setIlPluginActive().

ilCachedComponentData::$il_plugin_by_id = array()
protected

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

Referenced by getIlPluginById(), and setIlPluginById().

ilCachedComponentData::$il_plugin_by_name = array()
protected

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

Referenced by getIlPluginByName(), and setIlPluginByName().

ilCachedComponentData::$il_pluginslot_by_comp = array()
protected

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

Referenced by getIlPluginslotByComp().

ilCachedComponentData::$il_pluginslot_by_id = array()
protected

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

Referenced by getIlPluginslotById(), and setIlPluginslotById().

ilCachedComponentData::$il_pluginslot_by_name = array()
protected

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

Referenced by getIlPluginslotByName(), and setIlPluginslotByName().

ilCachedComponentData::$instance
staticprotected

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

Referenced by getInstance().

ilCachedComponentData::$loaded = false
protected

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

Referenced by getLoaded(), and setLoaded().

ilCachedComponentData::$obj_def_name_and_type_raw = array()
protected
ilCachedComponentData::$obj_def_name_to_id = array()
protected

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

Referenced by getObjDefNameToId(), and setObjDefNameToId().

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: