ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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.
static buildFieldFromRecord ($rec)

Static Protected Attributes

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

Detailed Description

Member Function Documentation

static ilDataCollectionCache::buildFieldFromRecord (   $rec)
static
Parameters
$rec
Returns
ilDataCollectionField

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

References $fields_cache.

Referenced by ilDataCollectionTable\loadFields().

{
if (isset($fields_cache[$rec["id"]])) {
return $fields_cache[$rec["id"]];
}
$field = new ilDataCollectionField();
$field->setId($rec["id"]);
$field->setTableId($rec["table_id"]);
$field->setTitle($rec["title"]);
$field->setDescription($rec["description"]);
$field->setDatatypeId($rec["datatype_id"]);
$field->setRequired($rec["required"]);
$field->setUnique($rec["is_unique"]);
$field->setLocked($rec["is_locked"]);
$fields_cache[$rec["id"]] = $field;
return $field;
}

+ Here is the caller graph for this function:

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

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

Referenced by getRecordFieldCache().

{
switch ($field->getDatatypeId()) {
return new ilDataCollectionRatingField($record, $field);
return new ilDataCollectionILIASRefField($record, $field);
if (!$field->isNRef()) {
return new ilDataCollectionReferenceField($record, $field);
} else {
return new ilDataCollectionNReferenceField($record, $field);
}
return new ilDataCollectionFormulaField($record, $field);
default:
return new ilDataCollectionRecordField($record, $field);
}
}

+ Here is the caller graph for this function:

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

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

References getInstance().

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

{
$fid = $field->getId();
$rid = $record->getId();
if (!isset(self::$record_field_cache[$rid])) {
self::$record_field_cache[$rid] = array();
self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
} elseif (!isset(self::$record_field_cache[$rid][$fid])) {
self::$record_field_cache[$rid][$fid] = self::getInstance($record, $field);
}
return self::$record_field_cache[$rid][$fid];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 41 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(), ilDataCollectionRecordEditGUI\executeCommand(), ilDataCollectionRecordViewViewdefinition\getAvailablePlaceholders(), ilDataCollectionRecordListGUI\getReferenceFromValue(), ilObjDataCollection\getTables(), ilDataCollectionFieldEditGUI\initForm(), ilDataCollectionRecordEditGUI\initForm(), ilDataCollectionRecord\loadTable(), ilDataCollectionRecordViewGUI\renderRecord(), ilDataCollectionFieldListGUI\save(), ilDataCollectionTableEditGUI\save(), and ilObjDataCollection\sendNotification().

{
if ($table_id == 0) {
return new ilDataCollectionTable();
}
if (!isset($tables_cache[$table_id])) {
$tables_cache[$table_id] = new ilDataCollectionTable($table_id);
}
return $tables_cache[$table_id];
}

+ Here is the caller graph for this function:

Field Documentation

ilDataCollectionCache::$fields_cache
staticprotected

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

Referenced by buildFieldFromRecord(), and getFieldCache().

ilDataCollectionCache::$record_field_cache
staticprotected

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

ilDataCollectionCache::$records_cache
staticprotected

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

Referenced by getRecordCache().

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: