ILIAS  release_4-3 Revision
 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

Class ilDataCollectionCache.

Author
: Oskar Truffer ot@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

This will cache all instances of the DataCollection module. never use new ilDataCollectionTable only use getTableCache

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

Member Function Documentation

static ilDataCollectionCache::buildFieldFromRecord (   $rec)
static

Definition at line 106 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 93 of file class.ilDataCollectionCache.php.

References 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);
return new ilDataCollectionReferenceField($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 75 of file class.ilDataCollectionCache.php.

References getInstance().

Referenced by ilDataCollectionRecordListTableGUI\getStatus(), ilDataCollectionRecordEditGUI\getValues(), 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:

Field Documentation

ilDataCollectionCache::$fields_cache
staticprotected

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

Referenced by buildFieldFromRecord(), and getFieldCache().

ilDataCollectionCache::$record_field_cache
staticprotected

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

ilDataCollectionCache::$records_cache
staticprotected

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

Referenced by getRecordCache().

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: