75 if (!self::$clone_mapping) {
78 self::$clone_mapping[
$type][$old] = $new;
83 self::$clone_mapping = array(
84 self::TYPE_DATACOLLECTION => array(),
85 self::TYPE_TABLE => array(),
86 self::TYPE_FIELD => array(),
87 self::TYPE_RECORD => array(),
88 self::TYPE_TABLEVIEW => array(),
94 $type_cache = self::$clone_mapping[
$type];
97 if (!is_array($type_cache)) {
101 if (isset($type_cache[
$id])) {
102 $clone_id = $type_cache[
$id];
104 foreach ($type_cache as
$key => $mapping) {
105 if ($mapping ==
$id) {
131 if (is_null($table_id) ===
true || $table_id === 0) {
166 $fid = $field->
getId();
167 $rid = $record->getId();
168 if (!isset(self::$record_field_cache[$rid])) {
169 self::$record_field_cache[$rid] = [];
171 } elseif (!isset(self::$record_field_cache[$rid][$fid])) {
175 return self::$record_field_cache[$rid][$fid];
183 if (!isset(self::$field_representation_cache[$field->
getId()])) {
187 return self::$field_representation_cache[$field->
getId()];
197 if ($record_field == null) {
198 throw new ilDclException(
"Cannot get Representation of null object!");
201 if (!isset(self::$record_representation_cache[$record_field->getId()])) {
205 return self::$record_representation_cache[$record_field->getId()];
215 if (!isset(self::$field_properties_cache[$field_id])) {
216 self::$field_properties_cache[$field_id] = array();
218 foreach ($result as $prop) {
219 self::$field_properties_cache[$field_id][$prop->getName()] = $prop;
223 return self::$field_properties_cache[$field_id];
232 foreach ($fields as $field_key => $field) {
233 if (isset(self::$field_properties_cache[$field->getId()])) {
234 unset($fields[$field_key]);
238 if (count($fields) > 0) {
239 $field_ids = array();
240 foreach ($fields as $field) {
241 $field_ids[] = $field->getId();
244 foreach ($result as $prop) {
245 if (!isset(self::$field_properties_cache[$prop->getFieldId()])) {
246 self::$field_properties_cache[$prop->getFieldId()] = array();
248 self::$field_properties_cache[$prop->getFieldId()][$prop->getName()] = $prop;
259 if (self::$datatype_cache ==
null) {
263 if (!isset(self::$datatype_cache[$datatyp_id])) {
267 return self::$datatype_cache[$datatyp_id];
272 $fields_cache = &self::$fields_cache;
273 if (isset($fields_cache[$rec[
"id"]])) {
274 return $fields_cache[$rec[
"id"]];
277 $field->setId($rec[
"id"]);
278 $field->setTableId($rec[
"table_id"]);
279 if (
null !== $rec[
"title"]) {
280 $field->setTitle($rec[
"title"]);
282 if (
null !== $rec[
"description"]) {
283 $field->setDescription($rec[
"description"]);
285 $field->setDatatypeId($rec[
"datatype_id"]);
286 $field->setUnique($rec[
"is_unique"]);
287 $fields_cache[$rec[
"id"]] = $field;
297 self::$fields_cache = array();
298 self::$record_field_cache = array();
299 self::$records_cache = array();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static where($where, $operator=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRecordCache(?int $record_id)
static getRecordFieldCache(object $record, object $field)
static getFieldProperties($field_id)
Cache Field properties.
static array $field_properties_cache
static array $fields_cache
static getFieldCache(int $field_id=0)
static resetCache()
Resets all the cache fields.
static buildFieldFromRecord(array $rec)
static getRecordRepresentation(ilDclBaseRecordFieldModel $record_field)
Returns a record representation.
static array $tables_cache
static array $clone_mapping
const TYPE_DATACOLLECTION
static initCloneMapping()
static array $datatype_cache
static array $record_representation_cache
static array $record_field_cache
static array $records_cache
static array $field_representation_cache
static getTableCache(int $table_id=null)
static preloadFieldProperties(array $fields)
Preloads field properties.
static getFieldRepresentation(ilDclBaseFieldModel $field)
static setCloneOf(int $old, int $new, string $type)
static getCloneOf(int $id, string $type)
static getDatatype(int $datatyp_id)
Get cached datatypes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllDatatype(bool $force=false)
Get all possible Datatypes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRecordRepresentationInstance(ilDclBaseRecordFieldModel $record_field)
Get RecordRepresentation from RecordFieldModel.
static getFieldRepresentationInstance(ilDclBaseFieldModel $field)
static getRecordModelInstance(?int $record_id)
static getRecordFieldInstance(object $field, object $record)
Creates a RecordField instance and loads the field and record representation.
static getFieldModelInstanceByClass(ilDclBaseFieldModel $field, ?int $field_id=null)
Gets the correct instance of a fieldModel class Checks if a field is a plugin a replaces the fieldMod...
static getFieldModelInstance(int $field_id, ?int $datatype=null)
Get FieldModel from field-id and datatype.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...