ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
Parameters
$rec
Returns
ilDataCollectionField

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

References $fields_cache.

Referenced by ilDataCollectionTable\loadFields().

140  {
141  $fields_cache = &self::$fields_cache;
142  if (isset($fields_cache[$rec["id"]])) {
143  return $fields_cache[$rec["id"]];
144  }
145  $field = new ilDataCollectionField();
146  $field->setId($rec["id"]);
147  $field->setTableId($rec["table_id"]);
148  $field->setTitle($rec["title"]);
149  $field->setDescription($rec["description"]);
150  $field->setDatatypeId($rec["datatype_id"]);
151  $field->setRequired($rec["required"]);
152  $field->setUnique($rec["is_unique"]);
153  $field->setLocked($rec["is_locked"]);
154  $fields_cache[$rec["id"]] = $field;
155 
156  return $field;
157  }
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 113 of file class.ilDataCollectionCache.php.

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

113  {
114  switch ($field->getDatatypeId()) {
116  return new ilDataCollectionRatingField($record, $field);
118  return new ilDataCollectionILIASRefField($record, $field);
120  if (!$field->isNRef()) {
121  return new ilDataCollectionReferenceField($record, $field);
122  } else {
123  return new ilDataCollectionNReferenceField($record, $field);
124  }
126  return new ilDataCollectionFormulaField($record, $field);
128  return new ilDataCollectionTextField($record, $field);
129  default:
130  return new ilDataCollectionRecordField($record, $field);
131  }
132  }
Class ilDataCollectionTextField.
Class ilDataCollectionNReferenceField.

◆ getRecordCache()

static ilDataCollectionCache::getRecordCache (   $record_id = 0)
static
Parameters
int$record_id
Returns
ilDataCollectionRecord

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

References $records_cache.

Referenced by ilDataCollectionReferenceField\__construct(), ilDataCollectionRecordViewGUI\__construct(), ilDataCollectionNReferenceFieldGUI\buildTemplate(), ilDataCollectionRecordEditGUI\confirmDelete(), ilDataCollectionRecordEditGUI\delete(), ilDataCollectionRecordViewGUI\doExtReplace(), ilDataCollectionRecordEditGUI\executeCommand(), ilDataCollectionReferenceField\getExportValue(), ilDataCollectionNReferenceField\getExportValue(), ilDataCollectionNReferenceFieldGUI\getHTML(), ilDataCollectionReferenceField\getLinkHTML(), ilDataCollectionTable\getPartialRecords(), ilDataCollectionRecordEditGUI\getRecordData(), ilDataCollectionDataSet\getXmlNamespace(), ilDataCollectionRecordEditGUI\initForm(), ilDataCollectionTable\loadRecords(), ilDataCollectionRecordEditGUI\save(), ilDataCollectionRecordListGUI\sendFile(), ilObjDataCollection\sendNotification(), and ilDataCollectionRecordEditGUI\setFormValues().

75  {
76  $records_cache = &self::$records_cache;
77  if (!isset($records_cache[$record_id])) {
78  $records_cache[$record_id] = new ilDataCollectionRecord($record_id);
79  }
80 
81  return $records_cache[$record_id];
82  }
Class ilDataCollectionRecord.
+ Here is the caller graph for this function:

◆ getRecordFieldCache()

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

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

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

91  {
92  $fid = $field->getId();
93  $rid = $record->getId();
94  if (!isset(self::$record_field_cache[$rid])) {
95  self::$record_field_cache[$rid] = array();
96  self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
97  } elseif (!isset(self::$record_field_cache[$rid][$fid])) {
98  self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
99  }
100 
101  return self::$record_field_cache[$rid][$fid];
102  }
+ Here is the caller graph for this function:

◆ getTableCache()

static ilDataCollectionCache::getTableCache (   $table_id = 0)
static
Parameters
int$table_id
Returns
ilDataCollectionTable

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

References $tables_cache.

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

42  {
43  if ($table_id == 0) {
44  return new ilDataCollectionTable();
45  }
46  $tables_cache = &self::$tables_cache;
47  if (!isset($tables_cache[$table_id])) {
48  $tables_cache[$table_id] = new ilDataCollectionTable($table_id);
49  }
50 
51  return $tables_cache[$table_id];
52  }
Class ilDataCollectionField.
+ Here is the caller graph for this function:

Field Documentation

◆ $fields_cache

ilDataCollectionCache::$fields_cache
staticprotected

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

Referenced by buildFieldFromRecord(), and getFieldCache().

◆ $record_field_cache

ilDataCollectionCache::$record_field_cache
staticprotected

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

◆ $records_cache

ilDataCollectionCache::$records_cache
staticprotected

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

Referenced by getRecordCache().

◆ $tables_cache

ilDataCollectionCache::$tables_cache
staticprotected

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

Referenced by getTableCache().


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