68        if (!self::$clone_mapping) {
 
   71        self::$clone_mapping[
$type][$old] = $new;
 
   77        self::$clone_mapping = array(
 
   78            self::TYPE_DATACOLLECTION => array(),
 
   79            self::TYPE_TABLE => array(),
 
   80            self::TYPE_FIELD => array(),
 
   81            self::TYPE_RECORD => array(),
 
   82            self::TYPE_TABLEVIEW => array(),
 
   89        $type_cache = self::$clone_mapping[
$type];
 
   90        if (!is_array($type_cache)) {
 
   94        if (isset($type_cache[
$id])) {
 
   95            $clone_id = $type_cache[
$id];
 
   97            foreach ($type_cache as 
$key => $mapping) {
 
   98                if ($mapping == 
$id) {
 
  128        if ($table_id == 0) {
 
  180        $fid = $field->getId();
 
  181        $rid = $record->getId();
 
  182        if (!isset(self::$record_field_cache[$rid])) {
 
  183            self::$record_field_cache[$rid] = array();
 
  185        } elseif (!isset(self::$record_field_cache[$rid][$fid])) {
 
  189        return self::$record_field_cache[$rid][$fid];
 
  201        if (!isset(self::$field_representation_cache[$field->
getId()])) {
 
  205        return self::$field_representation_cache[$field->
getId()];
 
  219        if ($record_field == 
null) {
 
  220            throw new ilDclException(
"Cannot get Representation of null object!");
 
  223        if (!isset(self::$record_representation_cache[$record_field->
getId()])) {
 
  227        return self::$record_representation_cache[$record_field->
getId()];
 
  240        if (!isset(self::$field_properties_cache[$field_id])) {
 
  241            self::$field_properties_cache[$field_id] = array();
 
  244                self::$field_properties_cache[$field_id][$prop->getName()] = $prop;
 
  248        return self::$field_properties_cache[$field_id];
 
  259        foreach ($fields as $field_key => $field) {
 
  260            if (isset(self::$field_properties_cache[$field->getId()])) {
 
  261                unset($fields[$field_key]);
 
  265        if (count($fields) > 0) {
 
  266            $field_ids = array();
 
  267            foreach ($fields as $field) {
 
  268                $field_ids[] = $field->getId();
 
  272                if (!isset(self::$field_properties_cache[$prop->getFieldId()])) {
 
  273                    self::$field_properties_cache[$prop->getFieldId()] = array();
 
  275                self::$field_properties_cache[$prop->getFieldId()][$prop->getName()] = $prop;
 
  291        if (self::$datatype_cache == 
null) {
 
  295        if (!isset(self::$datatype_cache[$datatyp_id])) {
 
  299        return self::$datatype_cache[$datatyp_id];
 
  315        $field->setId($rec[
"id"]);
 
  316        $field->setTableId($rec[
"table_id"]);
 
  317        $field->setTitle($rec[
"title"]);
 
  318        $field->setDescription($rec[
"description"]);
 
  319        $field->setDatatypeId($rec[
"datatype_id"]);
 
  320        $field->setRequired($rec[
"required"]);
 
  321        $field->setUnique($rec[
"is_unique"]);
 
  322        $field->setLocked($rec[
"is_locked"]);
 
  334        self::$fields_cache = array();
 
  335        self::$record_field_cache = array();
 
  336        self::$records_cache = array();
 
static where($where, $operator=null)
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldModel.
Class ilDclBaseFieldModel.
static getDatatype($datatyp_id)
Get cached datatypes.
static getRecordFieldCache($record, $field)
static getFieldProperties($field_id)
Cache Field properties.
static $field_properties_cache
static getTableCache($table_id=0)
static $field_representation_cache
static getRecordCache($record_id=0)
static resetCache()
Resets all the cache fields.
static $record_field_cache
static getRecordRepresentation(ilDclBaseRecordFieldModel $record_field)
Returns a record representation.
static getCloneOf($id, $type)
const TYPE_DATACOLLECTION
static initCloneMapping()
static buildFieldFromRecord($rec)
static setCloneOf($old, $new, $type)
static getFieldCache($field_id=0)
static preloadFieldProperties(array $fields)
Preloads field properties.
static getFieldRepresentation(ilDclBaseFieldModel $field)
static $record_representation_cache
static getAllDatatype()
Get all possible Datatypes.
static getRecordRepresentationInstance(ilDclBaseRecordFieldModel $record_field)
Get RecordRepresentation from RecordFieldModel.
static getFieldModelInstance($field_id, $datatype=null)
Get FieldModel from field-id and datatype.
static getFieldRepresentationInstance(ilDclBaseFieldModel $field)
Returns FieldRepresentation from BaseFieldModel.
static getRecordFieldInstance(ilDclBaseFieldModel $field, ilDclBaseRecordModel $record)
Creates a RecordField instance and loads the field and record representation.
static getFieldModelInstanceByClass(ilDclBaseFieldModel $field, $field_id=null)
Gets the correct instance of a fieldModel class Checks if a field is a plugin a replaces the fieldMod...
static getRecordModelInstance($record_id)
Creates a RecordModel instance.
Class ilDclBaseFieldModel.
Class ilObjDataCollection.
if(!array_key_exists('StateId', $_REQUEST)) $id