ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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)
 @description 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 137 of file class.ilDataCollectionCache.php.

137 {
139 if (isset($fields_cache[$rec["id"]])) {
140 return $fields_cache[$rec["id"]];
141 }
142 $field = new ilDataCollectionField();
143 $field->setId($rec["id"]);
144 $field->setTableId($rec["table_id"]);
145 $field->setTitle($rec["title"]);
146 $field->setDescription($rec["description"]);
147 $field->setDatatypeId($rec["datatype_id"]);
148 $field->setRequired($rec["required"]);
149 $field->setUnique($rec["is_unique"]);
150 $field->setLocked($rec["is_locked"]);
151 $fields_cache[$rec["id"]] = $field;
152
153 return $field;
154 }
Class ilDataCollectionField.

References $fields_cache.

Referenced by ilDataCollectionTable\loadFields().

+ Here is the caller graph for this function:

◆ getFieldCache()

◆ getInstance()

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

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

Parameters
$recordilDataCollectionRecord
$fieldilDataCollectionField
Returns
ilDataCollectionRecordField

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

112 {
113 switch ($field->getDatatypeId()) {
115 return new ilDataCollectionRatingField($record, $field);
117 return new ilDataCollectionILIASRefField($record, $field);
119 if (!$field->isNRef()) {
120 return new ilDataCollectionReferenceField($record, $field);
121 } else {
122 return new ilDataCollectionNReferenceField($record, $field);
123 }
125 return new ilDataCollectionFormulaField($record, $field);
126 default:
127 return new ilDataCollectionRecordField($record, $field);
128 }
129 }
Class ilDataCollectionNReferenceField.

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

Referenced by getRecordFieldCache().

+ Here is the caller graph for this function:

◆ getRecordCache()

◆ getRecordFieldCache()

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

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

90 {
91 $fid = $field->getId();
92 $rid = $record->getId();
93 if (!isset(self::$record_field_cache[$rid])) {
94 self::$record_field_cache[$rid] = array();
95 self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
96 } elseif (!isset(self::$record_field_cache[$rid][$fid])) {
97 self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
98 }
99
100 return self::$record_field_cache[$rid][$fid];
101 }
static getInstance($record, $field)
@description This function is used to decide which type of record field is to be instanciated.

References getInstance().

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

+ Here is the call graph for this function:
+ 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 41 of file class.ilDataCollectionCache.php.

41 {
42 if ($table_id == 0) {
43 return new ilDataCollectionTable();
44 }
46 if (!isset($tables_cache[$table_id])) {
47 $tables_cache[$table_id] = new ilDataCollectionTable($table_id);
48 }
49
50 return $tables_cache[$table_id];
51 }
Class ilDataCollectionField.

References $tables_cache.

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

+ Here is the caller graph for this function:

Field Documentation

◆ $fields_cache

ilDataCollectionCache::$fields_cache
staticprotected

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

Referenced by buildFieldFromRecord(), and getFieldCache().

◆ $record_field_cache

ilDataCollectionCache::$record_field_cache
staticprotected

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

◆ $records_cache

ilDataCollectionCache::$records_cache
staticprotected

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

Referenced by getRecordCache().

◆ $tables_cache

ilDataCollectionCache::$tables_cache
staticprotected

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

Referenced by getTableCache().


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