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)
 @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 140 of file class.ilDataCollectionCache.php.

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

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 113 of file class.ilDataCollectionCache.php.

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 ilDataCollectionNReferenceField.
Class ilDataCollectionTextField.

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

Referenced by getRecordFieldCache().

+ Here is the caller graph for this function:

◆ getRecordCache()

static ilDataCollectionCache::getRecordCache (   $record_id = 0)
static

◆ getRecordFieldCache()

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

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

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 }
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 42 of file class.ilDataCollectionCache.php.

42 {
43 if ($table_id == 0) {
44 return new ilDataCollectionTable();
45 }
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.

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(), ilDataCollectionReferenceField\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 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: