ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDataCollectionCache Class Reference

Class ilDataCollectionCache. More...

+ Collaboration diagram for ilDataCollectionCache:

Static Public Member Functions

static getTableCache ($table_id=0)
 
static getFieldCache ($field_id=0)
 
static getRecordCache ($record_id=0)
 
static getRecordFieldCache ($record, $field)
 
static getInstance ($record, $field)
 This function is used to decide which type of record field is to be instanciated. More...
 
static buildFieldFromRecord ($rec)
 

Static Protected Attributes

static $tables_cache
 
static $fields_cache
 
static $records_cache
 
static $record_field_cache
 

Detailed Description

Member Function Documentation

◆ buildFieldFromRecord()

static ilDataCollectionCache::buildFieldFromRecord (   $rec)
static

Definition at line 92 of file class.ilDataCollectionCache.php.

References $fields_cache.

Referenced by ilDataCollectionTable\loadFields().

92  {
93  $fields_cache = &self::$fields_cache;
94  if(isset($fields_cache[$rec["id"]])){
95  return $fields_cache[$rec["id"]];
96  }
97  $field = new ilDataCollectionField();
98  $field->setId($rec["id"]);
99  $field->setTableId($rec["table_id"]);
100  $field->setTitle($rec["title"]);
101  $field->setDescription($rec["description"]);
102  $field->setDatatypeId($rec["datatype_id"]);
103  $field->setRequired($rec["required"]);
104  $field->setUnique($rec["is_unique"]);
105  $field->setLocked($rec["is_locked"]);
106  $fields_cache[$rec["id"]] = $field;
107  return $field;
108  }
Class ilDataCollectionField.
+ Here is the caller graph for this function:

◆ getFieldCache()

◆ getInstance()

static ilDataCollectionCache::getInstance (   $record,
  $field 
)
static

This function is used to decide which type of record field is to be instanciated.

Parameters
$recordilDataCollectionRecord
$fieldilDataCollectionField
Returns
ilDataCollectionRecordField

Definition at line 76 of file class.ilDataCollectionCache.php.

References ilDataCollectionDatatype\INPUTFORMAT_ILIAS_REF, ilDataCollectionDatatype\INPUTFORMAT_RATING, and ilDataCollectionDatatype\INPUTFORMAT_REFERENCE.

76  {
77  switch($field->getDatatypeId()){
79  return new ilDataCollectionRatingField($record, $field);
81  return new ilDataCollectionILIASRefField($record, $field);
83  if(!$field->isNRef())
84  return new ilDataCollectionReferenceField($record, $field);
85  else
86  return new ilDataCollectionNReferenceField($record, $field);
87  default:
88  return new ilDataCollectionRecordField($record, $field);
89  }
90  }

◆ getRecordCache()

◆ getRecordFieldCache()

static ilDataCollectionCache::getRecordFieldCache (   $record,
  $field 
)
static
Parameters
$fieldilDataCollectionField
$recordilDataCollectionRecord
Returns
ilDataCollectionRecordField

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

Referenced by ilDataCollectionRecordListTableGUI\getStatus(), and ilDataCollectionRecord\loadRecordFields().

58  {
59  $fid = $field->getId();
60  $rid = $record->getId();
61  if(!isset(self::$record_field_cache[$rid])){
62  self::$record_field_cache[$rid] = array();
63  self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
64  }elseif(!isset(self::$record_field_cache[$rid][$fid])){
65  self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
66  }
67  return self::$record_field_cache[$rid][$fid];
68  }
+ Here is the caller graph for this function:

◆ getTableCache()

static ilDataCollectionCache::getTableCache (   $table_id = 0)
static

Definition at line 32 of file class.ilDataCollectionCache.php.

References $tables_cache.

Referenced by ilDataCollectionFieldListTableGUI\__construct(), ilDataCollectionRecordEditGUI\__construct(), ilDataCollectionRatingField\__construct(), ilDataCollectionReferenceField\__construct(), ilDataCollectionILIASRefField\__construct(), ilDataCollectionTableEditGUI\__construct(), ilDataCollectionFieldEditGUI\__construct(), ilDataCollectionRecordListGUI\__construct(), ilDataCollectionDatatype\addFilterInputFieldToTable(), ilDataCollectionField\checkValidity(), ilObjDataCollection\cloneStructure(), ilDataCollectionTable\cloneStructure(), ilObjDataCollection\doCreate(), ilDataCollectionTableEditGUI\edit(), ilObjDataCollectionGUI\emptyInfo(), ilDataCollectionRecordViewViewdefinition\getAvailablePlaceholders(), ilDataCollectionReferenceField\getLinkHTML(), ilDataCollectionRecordListGUI\getReferenceFromValue(), ilObjDataCollection\getTables(), ilDataCollectionRecordEditGUI\initForm(), ilDataCollectionRecord\loadTable(), ilDataCollectionRecordViewGUI\renderRecord(), ilDataCollectionFieldListGUI\save(), ilDataCollectionTableEditGUI\save(), and ilObjDataCollection\sendNotification().

32  {
33  $tables_cache = &self::$tables_cache;
34  if(!isset($tables_cache[$table_id]))
35  $tables_cache[$table_id] = new ilDataCollectionTable($table_id);
36  return $tables_cache[$table_id];
37  }
Class ilDataCollectionField.
+ Here is the caller graph for this function:

Field Documentation

◆ $fields_cache

ilDataCollectionCache::$fields_cache
staticprotected

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

Referenced by buildFieldFromRecord(), and getFieldCache().

◆ $record_field_cache

ilDataCollectionCache::$record_field_cache
staticprotected

Definition at line 29 of file class.ilDataCollectionCache.php.

◆ $records_cache

ilDataCollectionCache::$records_cache
staticprotected

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

Referenced by getRecordCache().

◆ $tables_cache

ilDataCollectionCache::$tables_cache
staticprotected

Definition at line 13 of file class.ilDataCollectionCache.php.

Referenced by getTableCache().


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