19declare(strict_types=1);
49 'il_dcl_field_prop' => [],
50 'il_dcl_sel_opts' => [],
51 'il_dcl_record' => [],
52 'il_dcl_record_field' => [],
53 'il_dcl_stloc1_value' => [],
54 'il_dcl_stloc2_value' => [],
55 'il_dcl_stloc3_value' => [],
56 'il_dcl_stloc1_default' => [],
57 'il_dcl_stloc2_default' => [],
58 'il_dcl_stloc3_default' => [],
59 'il_dcl_tfield_set' => [],
60 'il_dcl_tableview' => [],
61 'il_dcl_tview_set' => [],
80 $this->db =
$DIC->database();
81 $this->
user = $DIC->user();
87 return [
'4.5.0',
'8.13'];
94 public function getCache(
string $a_entity): array
96 if (!in_array($a_entity, array_keys($this->caches))) {
97 throw new ilException(
"Entity '$a_entity' does not exist in Cache");
100 return $this->caches[$a_entity];
103 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
105 return 'https://www.ilias.de/xml/Modules/DataCollection/' . $a_entity;
113 string $a_schema_version
115 foreach ($a_rec as $key => &$value) {
116 $array = json_decode($value,
true);
117 if (is_array($array)) {
120 $value = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform($value);
125 if ($new_id = $a_mapping->
getMapping(
'components/ILIAS/Container',
'objs', $a_rec[
'id'])) {
129 $new_obj->create(
true);
131 $new_obj->setTitle($a_rec[
'title']);
132 $new_obj->setDescription($a_rec[
'description']);
133 $new_obj->setApproval($a_rec[
'approval'] ===
'1');
134 $new_obj->setPublicNotes($a_rec[
'public_notes'] ===
'1');
135 $new_obj->setNotification($a_rec[
'notification'] ===
'1');
136 $new_obj->setRating($a_rec[
'rating'] ===
'1');
138 $this->import_dc_object = $new_obj;
139 $a_mapping->
addMapping(
'components/ILIAS/DataCollection',
'dcl', $a_rec[
'id'], (
string) $new_obj->getId());
141 'components/ILIAS/MetaData',
143 $a_rec[
'id'] .
':0:dcl',
144 $new_obj->getId() .
':0:dcl'
149 $table->setTitle($a_rec[
'title']);
150 $table->setObjId($this->import_dc_object->getId());
151 $table->setDescription($a_rec[
'description']);
152 $table->setAddPerm($a_rec[
'add_perm'] ===
'1');
153 $table->setEditPerm($a_rec[
'edit_perm'] ===
'1');
154 $table->setDeletePerm($a_rec[
'delete_perm'] ===
'1');
155 $table->setEditByOwner($a_rec[
'edit_by_owner'] ===
'1');
156 $table->setLimited($a_rec[
'limited'] ===
'1');
157 $table->setLimitStart($a_rec[
'limit_start']);
158 $table->setLimitEnd($a_rec[
'limit_end']);
159 $table->setIsVisible($a_rec[
'is_visible'] ===
'1');
160 $table->setExportEnabled($a_rec[
'export_enabled'] ===
'1');
161 $table->setImportEnabled($a_rec[
'import_enabled'] ===
'1');
162 $table->setDefaultSortField($a_rec[
'default_sort_field_id']);
163 $table->setDefaultSortFieldOrder($a_rec[
'default_sort_field_order']);
164 $table->setPublicCommentsEnabled($a_rec[
'public_comments'] ===
'1');
165 $table->setViewOwnRecordsPerm($a_rec[
'view_own_records_perm'] ===
'1');
166 $table->setDeleteByOwner($a_rec[
'delete_by_owner'] ===
'1');
167 $table->setSaveConfirmation($a_rec[
'save_confirmation'] ===
'1');
168 $table->setOrder((
int) $a_rec[
'table_order']);
169 $table->doCreate(
false,
false);
170 $a_mapping->
addMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'id'], (
string) $table->getId());
172 case 'il_dcl_tableview':
173 $new_table_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
176 $tableview->setTitle($a_rec[
'title']);
177 $tableview->setTableId((
int) $new_table_id);
178 $tableview->setDescription($a_rec[
'description']);
179 if (!is_array($a_rec[
'roles'])) {
180 $a_rec[
'roles'] = json_decode($a_rec[
'roles']);
182 $tableview->setRoles($a_rec[
'roles']);
183 $tableview->create(
false);
186 'components/ILIAS/DataCollection',
189 (
string) $tableview->getId()
191 $a_mapping->
addMapping(
'components/ILIAS/COPage',
'pg',
'dclf:' . $a_rec[
'id'],
'dclf:' . $tableview->getId());
195 $new_table_id = (
int) $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
196 if ($new_table_id > 0) {
197 $datatype_id = (
int) $a_rec[
'datatype_id'];
198 $datatype = $a_rec[
'datatype_title'] ??
null;
202 foreach ($datatypes as $dt) {
203 if ($dt->getTitle() === $datatype) {
204 $datatype_id = $dt->getId();
208 if (in_array($datatype_id, array_keys($datatypes))) {
210 $field->setTableId($new_table_id);
211 $field->setDatatypeId($datatype_id);
212 $field->setTitle($a_rec[
'title']);
213 $field->setDescription($a_rec[
'description']);
218 $a_mapping->
addMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'id'], $field->getId());
222 case 'il_dcl_tfield_set':
223 $new_table_id = (
int) $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
224 $new_field_id = is_numeric($a_rec[
'field']) ? $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field']) : $a_rec[
'field'];
225 if ($new_table_id > 0 && (is_string($new_field_id) || $new_field_id > 0)) {
230 $setting->setFieldOrder((
int) $a_rec[
'field_order']);
231 $setting->setExportable($a_rec[
'exportable'] ===
'1');
235 case 'il_dcl_tview_set':
237 'components/ILIAS/DataCollection',
239 $a_rec[
'tableview_id']
241 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field']);
242 if ($new_tableview_id) {
244 $setting->setTableviewId((
int) $new_tableview_id);
245 $setting->setVisible($a_rec[
'visible'] ===
'1');
246 $setting->setField($new_field_id ?: $a_rec[
'field']);
247 $setting->setInFilter($a_rec[
'in_filter'] ===
'1');
248 $setting->setFilterValue($a_rec[
'filter_value']);
249 $setting->setFilterChangeable($a_rec[
'filter_changeable'] ===
'1');
250 $setting->setRequiredCreate($a_rec[
'required_create'] ===
'1');
251 $setting->setLockedCreate($a_rec[
'locked_create'] ===
'1');
252 $setting->setVisibleCreate($a_rec[
'visible_create'] ===
'1');
253 $setting->setVisibleEdit($a_rec[
'visible_edit'] ===
'1');
254 $setting->setRequiredEdit($a_rec[
'required_edit'] ===
'1');
255 $setting->setLockedEdit($a_rec[
'locked_edit'] ===
'1');
256 $setting->setDefaultValue($a_rec[
'default_value']);
259 'components/ILIAS/DataCollection',
262 (
string) $setting->getId()
266 case 'il_dcl_record':
267 $new_table_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
270 $record->setTableId((
int) $new_table_id);
274 $record->setOwner($this->
user->getId());
275 $record->setLastEditBy($this->
user->getId());
278 'components/ILIAS/DataCollection',
281 (
string) $record->getId()
286 $new_table_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
291 if ($a_rec[
'type'] == 0 && $a_rec[
'formtype'] == 0) {
294 'components/ILIAS/COPage',
296 'dclf:' . $a_rec[
'id'],
297 'dclf:' . $tableview->getId()
300 'components/ILIAS/DataCollection',
303 (
string) $tableview->getId()
307 'components/ILIAS/DataCollection',
310 json_encode([
'type' => $a_rec[
'type'],
311 'table_id' => $new_table_id,
312 'tableview_id' => $tableview->getId()
318 case 'il_dcl_viewdefinition':
319 $map = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_view', $a_rec[
'view_id']);
320 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field']);
321 $field = ($new_field_id) ?: $a_rec[
'field'];
322 switch ($map[
'type']) {
325 $viewfield_setting->setVisible($a_rec[
'is_set']);
326 $viewfield_setting->store();
330 $viewfield_setting->setInFilter($a_rec[
'is_set']);
331 $viewfield_setting->store();
335 $tablefield_setting->setExportable($a_rec[
'is_set']);
336 $tablefield_setting->setFieldOrder($a_rec[
'field_order']);
337 $tablefield_setting->store();
341 case 'il_dcl_sel_opts':
342 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
345 $opt->setFieldId((
int) $new_field_id);
346 $opt->setOptId((
int) $a_rec[
'opt_id']);
347 $opt->setSorting((
int) $a_rec[
'sorting']);
348 $opt->setValue($a_rec[
'value']);
352 case 'il_dcl_field_prop':
353 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
356 $prop->setFieldId((
int) $new_field_id);
359 $name = $a_rec[
'name'];
360 if (!isset($name) && isset($a_rec[
'datatype_prop_id'])) {
366 5 =>
'reference_link',
369 8 =>
'learning_progress',
370 9 =>
'ILIAS_reference_link',
371 10 =>
'multiple_selection',
373 12 =>
'display_action_menu',
374 13 =>
'link_detail_page',
375 14 =>
'link_detail_page',
378 $name = $properties[$a_rec[
'datatype_prop_id']];
381 if ($name ===
'text_area' && $a_rec[
'value'] ===
'1') {
389 $prop->setName($name);
390 $prop->setValue($a_rec[
'value']);
393 'components/ILIAS/DataCollection',
396 (
string) $prop->getId()
398 $this->import_temp_refs_props[$prop->getId()] = $a_rec[
'value'];
401 case 'il_dcl_record_field':
402 $record_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_record', $a_rec[
'record_id']);
403 $field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
404 if ($record_id && $field_id) {
409 'components/ILIAS/DataCollection',
410 'il_dcl_record_field',
412 (
string) $record_field->getId()
414 $this->import_record_field_cache[$record_field->getId()] = $record_field;
417 case 'il_dcl_stloc1_value':
418 case 'il_dcl_stloc2_value':
419 case 'il_dcl_stloc3_value':
420 $new_record_field_id = $a_mapping->
getMapping(
421 'components/ILIAS/DataCollection',
422 'il_dcl_record_field',
423 $a_rec[
'record_field_id']
425 if ($new_record_field_id) {
427 $record_field = $this->import_record_field_cache[$new_record_field_id];
428 if (is_object($record_field)) {
431 switch ($record_field->getField()->getDatatypeId()) {
433 $new_file_id = $a_mapping->
getMapping(
'components/ILIAS/File',
'file', $a_rec[
'value']);
434 $value = ($new_file_id) ? (
int) $new_file_id :
null;
438 $value = $a_rec[
'value'];
439 $decode = json_decode($a_rec[
'value']);
440 if (is_array($decode)) {
441 foreach ($decode as
$id) {
442 $this->import_temp_refs[$new_record_field_id][] =
$id;
445 $this->import_temp_refs[$new_record_field_id] = $value;
455 $value = $a_rec[
'value'];
456 if ($value ==
'0000-00-00 00:00:00') {
461 if (version_compare($a_schema_version,
"8.13") < 0) {
462 $a_rec[
'value'] = str_replace(
'<br />',
'', $a_rec[
'value']);
466 $value = $a_rec[
'value'];
467 if ($a_entity ==
'il_dcl_stloc3_value' && empty($value)) {
471 $record_field->setValue($value,
true);
472 $record_field->doUpdate();
476 case 'il_dcl_stloc1_default':
477 case 'il_dcl_stloc2_default':
478 case 'il_dcl_stloc3_default':
481 'components/ILIAS/DataCollection',
483 $a_rec[
'tview_set_id']
487 $value = $a_rec[
'value'];
491 $value = (
int) $value;
493 $stloc_default->setValue($value);
494 $stloc_default->setTviewSetId((
int) $tview_set_id);
495 $stloc_default->create();
505 foreach ($array as $key => $value) {
507 if (is_string($key)) {
508 $newkey = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform($key);
511 if (is_string($value)) {
512 $newvalue = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform($value);
514 if (is_array($value)) {
515 $newvalue = $this->escapeArray($value);
517 $new[$newkey] = $newvalue;
528 foreach ($this->import_dc_object->getTables() as $table) {
529 if (is_numeric($table->getDefaultSortField())) {
530 $table->setDefaultSortField(
531 $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $table->getDefaultSortField())
536 foreach ($this->import_temp_new_mob_ids as $new_mob_id) {
541 foreach ($this->import_temp_refs as $record_field_id => $old_record_id) {
542 if (is_array($old_record_id)) {
544 foreach ($old_record_id as
$id) {
545 $new_record_id[] = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_record',
$id);
547 $value = $new_record_id;
549 $value = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_record', $old_record_id);
552 $record_field = $this->import_record_field_cache[$record_field_id];
553 $record_field->setValue($value,
true);
554 $record_field->doUpdate();
556 foreach ($this->import_temp_refs_props as $field_prop_id => $prop_value) {
557 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $prop_value);
558 $value = ($new_field_id) ? (
int) $new_field_id : $prop_value;
561 $field_prop->setValue($value);
562 $field_prop->update();
569 protected function getTypes(
string $a_entity,
string $a_version): array
576 "description" =>
"text",
577 'is_online' =>
'integer',
578 'rating' =>
'integer',
579 'public_notes' =>
'integer',
580 'approval' =>
'integer',
581 'notification' =>
'integer',
586 'obj_id' =>
'integer',
588 'add_perm' =>
'integer',
589 'edit_perm' =>
'integer',
590 'delete_perm' =>
'integer',
591 'edit_by_owner' =>
'integer',
592 'limited' =>
'integer',
593 'limit_start' =>
'text',
594 'limit_end' =>
'text',
595 'is_visible' =>
'integer',
596 'export_enabled' =>
'integer',
597 'import_enabled' =>
'integer',
598 'default_sort_field_id' =>
'text',
599 'default_sort_field_order' =>
'text',
600 'description' =>
'text',
601 'public_comments' =>
'integer',
602 'view_own_records_perm' =>
'integer',
603 'delete_by_owner' =>
'integer',
604 'save_confirmation' =>
'integer',
605 'table_order' =>
'integer',
607 case 'il_dcl_tableview':
610 'table_id' =>
'integer',
613 'description' =>
'text',
618 'table_id' =>
'integer',
620 'description' =>
'text',
621 'datatype_id' =>
'integer',
622 'datatype_title' =>
'text',
624 case 'il_dcl_tview_set':
627 'tableview_id' =>
'integer',
629 'visible' =>
'integer',
630 'in_filter' =>
'integer',
631 'filter_value' =>
'text',
632 'filter_changeable' =>
'integer',
633 'required_create' =>
'integer',
634 'required_edit' =>
'integer',
635 'locked_create' =>
'integer',
636 'locked_edit' =>
'integer',
637 'visible_create' =>
'integer',
638 'visible_edit' =>
'integer',
639 'default_value' =>
'text',
641 case 'il_dcl_tfield_set':
644 'table_id' =>
'integer',
646 'field_order' =>
'integer',
647 'exportable' =>
'integer',
649 case 'il_dcl_field_prop':
652 'field_id' =>
'integer',
654 'value' =>
'integer',
656 case 'il_dcl_sel_opts':
659 'field_id' =>
'integer',
660 'opt_id' =>
'integer',
661 'sorting' =>
'integer',
664 case 'il_dcl_record':
667 'table_id' =>
'integer',
669 case 'il_dcl_record_field':
672 'record_id' =>
'integer',
673 'field_id' =>
'integer',
675 case 'il_dcl_stloc1_value':
676 case 'il_dcl_stloc2_value':
677 case 'il_dcl_stloc3_value':
680 'record_field_id' =>
'integer',
683 case 'il_dcl_stloc1_default':
684 case 'il_dcl_stloc2_default':
685 case 'il_dcl_stloc3_default':
688 'tview_set_id' =>
'integer',
707 ?array $a_rec =
null,
710 if (!$a_rec && !$a_ids) {
715 $set = $this->db->query(
'SELECT * FROM il_dcl_table WHERE obj_id = ' . $this->db->quote(
719 $ids = $this->buildCache(
'il_dcl_table', $set);
722 'il_dcl_table' => [
'ids' => $ids],
725 $set = $this->db->query(
'SELECT * FROM il_dcl_record WHERE table_id = ' . $this->db->quote(
729 $ids_records = $this->buildCache(
'il_dcl_record', $set);
730 $set = $this->db->query(
'SELECT il_dcl_field.*, il_dcl_datatype.title as datatype_title FROM il_dcl_field INNER JOIN il_dcl_datatype ON il_dcl_field.datatype_id = il_dcl_datatype.id WHERE table_id = ' . $this->db->quote(
734 $ids_fields = $this->buildCache(
'il_dcl_field', $set);
735 $set = $this->db->query(
'SELECT * FROM il_dcl_tableview WHERE table_id = ' . $this->db->quote(
739 $ids_tableviews = $this->buildCache(
'il_dcl_tableview', $set);
740 $set = $this->db->query(
'SELECT * FROM il_dcl_tfield_set WHERE table_id = ' . $this->db->quote(
744 $ids_tablefield_settings = $this->buildCache(
'il_dcl_tfield_set', $set);
747 'il_dcl_field' => [
'ids' => $ids_fields],
748 'il_dcl_record' => [
'ids' => $ids_records],
749 'il_dcl_tableview' => [
'ids' => $ids_tableviews],
750 'il_dcl_tfield_set' => [
'ids' => $ids_tablefield_settings],
753 $set = $this->db->query(
'SELECT * FROM il_dcl_field_prop WHERE field_id = ' . $this->db->quote(
757 $prop_ids = $this->buildCache(
'il_dcl_field_prop', $set);
759 $set = $this->db->query(
'SELECT * FROM il_dcl_sel_opts WHERE field_id = ' . $this->db->quote(
763 $opt_ids = $this->buildCache(
'il_dcl_sel_opts', $set);
766 'il_dcl_field_prop' => [
'ids' => $prop_ids],
767 'il_dcl_sel_opts' => [
'ids' => $opt_ids],
769 case 'il_dcl_record':
770 $sql =
'SELECT rf.*, d.storage_location FROM il_dcl_record_field AS rf' .
' INNER JOIN il_dcl_field AS f ON (f.id = rf.field_id)'
771 .
' INNER JOIN il_dcl_datatype AS d ON (f.datatype_id = d.id) ' .
' WHERE rf.record_id = '
772 . $this->db->quote($a_rec[
'id'],
'integer');
773 $set = $this->db->query($sql);
774 $ids = $this->buildCache(
'il_dcl_record_field', $set);
776 $set = $this->db->query($sql);
777 while ($rec = $this->db->fetchObject($set)) {
782 =
'SELECT rf.id AS record_field_id, st1.value AS value1, st2.value AS value2, st3.value AS value3 FROM il_dcl_record_field AS rf '
783 .
'LEFT JOIN il_dcl_stloc1_value AS st1 ON (st1.record_field_id = rf.id) '
784 .
'LEFT JOIN il_dcl_stloc2_value AS st2 ON (st2.record_field_id = rf.id) '
785 .
'LEFT JOIN il_dcl_stloc3_value AS st3 ON (st3.record_field_id = rf.id) ' .
'WHERE rf.record_id = '
786 . $this->db->quote($a_rec[
'id'],
'integer');
787 $set = $this->db->query($sql);
789 while ($rec = $this->db->fetchObject($set)) {
790 $stloc = $this->record_field_ids_2_storage[$rec->record_field_id];
793 $value =
"value$stloc";
794 $value = $rec->{$value};
797 $this->caches[
"il_dcl_stloc{$stloc}_value"][$rec->record_field_id] = [
798 'record_field_id' => $rec->record_field_id,
804 'il_dcl_record_field' => [
'ids' => $ids],
806 case 'il_dcl_tableview':
807 $set = $this->db->query(
'SELECT * FROM il_dcl_tview_set WHERE tableview_id = ' . $this->db->quote(
811 $ids = $this->buildCache(
'il_dcl_tview_set', $set);
814 'il_dcl_tview_set' => [
'ids' => $ids],
816 case 'il_dcl_tview_set':
818 if (!(
int) $a_rec[
'field'] > 0) {
824 SELECT tview_set.id AS tview_set_id, st1.value AS value1, st2.value AS value2, st3.value AS value3,
825 st1.id AS id1, st2.id AS id2, st3.id AS id3
826 FROM il_dcl_tview_set AS tview_set
827 LEFT JOIN il_dcl_stloc1_default AS st1 ON (st1.tview_set_id = tview_set.id)
828 LEFT JOIN il_dcl_stloc2_default AS st2 ON (st2.tview_set_id = tview_set.id)
829 LEFT JOIN il_dcl_stloc3_default AS st3 ON (st3.tview_set_id = tview_set.id)
830 WHERE tview_set.id = ' . $this->db->quote($a_rec[
'id'],
'integer');
831 $set = $this->db->query($sql);
833 while ($rec = $this->db->fetchObject($set)) {
836 $value_str =
"value$stloc";
837 $value = $rec->{$value_str};
838 $id_str =
"id$stloc";
839 $id = $rec->{$id_str};
840 $tview_set_id = $rec->tview_set_id;
843 $this->caches[
"il_dcl_stloc" .
"$stloc" .
"_default"][$rec->tview_set_id] = [
845 'tview_set_id' => $rec->tview_set_id,
850 "il_dcl_stloc{$stloc}_default" => [
'ids' => [$tview_set_id]],
855 case 'il_dcl_record_field':
856 $record_field_id = $a_rec[
'id'];
857 $storage_loc = $this->record_field_ids_2_storage[$record_field_id];
860 "il_dcl_stloc{$storage_loc}_value" => [
'ids' => [$record_field_id]],
871 public function readData(
string $a_entity,
string $a_version, array $a_ids): void
874 $this->_readData($a_entity, $a_ids);
882 protected function _readData(
string $a_entity, array $a_ids): void
886 foreach ($a_ids as $dcl_id) {
891 'title' => $obj->getTitle(),
892 'description' => $obj->getDescription(),
893 'is_online' => $obj->getOnline() ?
'1' :
'0',
894 'rating' => $obj->getRating() ?
'1' :
'0',
895 'public_notes' => $obj->getPublicNotes() ?
'1' :
'0',
896 'approval' => $obj->getApproval() ?
'1' :
'0',
897 'notification' => $obj->getNotification() ?
'1' :
'0',
899 $this->caches[
'dcl'][$dcl_id] =
$data;
900 $this->data[] =
$data;
905 $data = $this->getCache($a_entity);
906 foreach ($a_ids as
$id) {
914 $fields = array_keys($this->getTypes($a_entity,
''));
916 while ($rec = $this->db->fetchObject($set)) {
918 foreach ($fields as $field) {
919 $data[$field] = $rec->{$field};
922 $this->caches[$a_entity][
$id] =
$data;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getXmlNamespace(string $a_entity, string $a_schema_version)
ILIAS Refinery Factory $refinery
ilObjDataCollection $import_dc_object
_readData(string $a_entity, array $a_ids)
Build data array, data is read from cache except dcl object itself.
array $import_temp_refs_props
array $record_field_ids_2_storage
escapeArray(array $array)
buildCache(string $a_entity, ilDBStatement $set)
array $import_temp_new_mob_ids
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
Return dependencies form entities to other entities (in our case these are all the DB relations)
readData(string $a_entity, string $a_version, array $a_ids)
Read data from Cache for a given entity and ID(s)
array $import_record_field_cache
Caches ilDclBaseRecordFieldModel objects.
getCache(string $a_entity)
Get cached data from a given entity.
getTypes(string $a_entity, string $a_version)
Map XML attributes of entities to datatypes (text, integer...)
A dataset contains in data in a common structure that can be shared and transformed for different pur...
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Needs to be overwritten for import use case.
@classDescription Date and time handling
hasProperty(string $key)
Checks if a certain property for a field is set.
const PROP_LENGTH
General properties.
static getRecordCache(?int $record_id)
static getFieldCache(int $field_id=0)
const INPUTFORMAT_ILIAS_REF
const INPUTFORMAT_FILEUPLOAD
const INPUTFORMAT_REFERENCELIST
const INPUTFORMAT_DATETIME
static getAllDatatype(bool $force=false)
Get all possible Datatypes.
const INPUTFORMAT_REFERENCE
static isPluginDatatype(string $datatype)
static getInstance(int $table_id, string $field)
static getInstance(int $tableview_id, int $field_id)
static returnDbTableName()
static createOrGetStandardView(int $table_id)
Base class for ILIAS Exception handling.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupType(int $id, bool $reference=false)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))