19 declare(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' => [],
79 $this->db = $DIC->database();
80 $this->
user = $DIC->user();
85 return [
'4.5.0',
'8.13'];
92 public function getCache(
string $a_entity): array
94 if (!in_array($a_entity, array_keys($this->caches))) {
95 throw new ilException(
"Entity '$a_entity' does not exist in Cache");
98 return $this->caches[$a_entity];
101 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
103 return 'https://www.ilias.de/xml/Modules/DataCollection/' . $a_entity;
111 string $a_schema_version
113 foreach ($a_rec as
$key => &$value) {
114 $array = json_decode($value,
true);
115 if (
$key ===
'title' ||
$key ===
'description') {
117 } elseif (is_array($array)) {
120 $value = htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8');
125 if ($new_id = $a_mapping->
getMapping(
'Services/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(
'Modules/DataCollection',
'dcl', $a_rec[
'id'], (
string) $new_obj->getId());
143 $table->setTitle($a_rec[
'title']);
144 $table->setObjId($this->import_dc_object->getId());
145 $table->setDescription($a_rec[
'description']);
146 $table->setAddPerm($a_rec[
'add_perm'] ===
'1');
147 $table->setEditPerm($a_rec[
'edit_perm'] ===
'1');
148 $table->setDeletePerm($a_rec[
'delete_perm'] ===
'1');
149 $table->setEditByOwner($a_rec[
'edit_by_owner'] ===
'1');
150 $table->setLimited($a_rec[
'limited'] ===
'1');
151 $table->setLimitStart($a_rec[
'limit_start']);
152 $table->setLimitEnd($a_rec[
'limit_end']);
153 $table->setIsVisible($a_rec[
'is_visible'] ===
'1');
154 $table->setExportEnabled($a_rec[
'export_enabled'] ===
'1');
155 $table->setImportEnabled($a_rec[
'import_enabled'] ===
'1');
156 $table->setDefaultSortField($a_rec[
'default_sort_field_id']);
157 $table->setDefaultSortFieldOrder($a_rec[
'default_sort_field_order']);
158 $table->setPublicCommentsEnabled($a_rec[
'public_comments'] ===
'1');
159 $table->setViewOwnRecordsPerm($a_rec[
'view_own_records_perm'] ===
'1');
160 $table->setDeleteByOwner($a_rec[
'delete_by_owner'] ===
'1');
161 $table->setSaveConfirmation($a_rec[
'save_confirmation'] ===
'1');
162 $table->setOrder((
int) $a_rec[
'table_order']);
163 $table->doCreate(
false,
false);
164 $a_mapping->
addMapping(
'Modules/DataCollection',
'il_dcl_table', $a_rec[
'id'], (
string) $table->getId());
166 case 'il_dcl_tableview':
167 $new_table_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
170 $tableview->setTitle($a_rec[
'title']);
171 $tableview->setTableId((
int) $new_table_id);
172 $tableview->setDescription($a_rec[
'description']);
173 $tableview->setTableviewOrder((
int) $a_rec[
'tableview_order']);
174 if (!is_array($a_rec[
'roles'])) {
175 $a_rec[
'roles'] = json_decode($a_rec[
'roles']);
177 $tableview->setRoles($a_rec[
'roles']);
178 $tableview->create(
false);
181 'Modules/DataCollection',
184 (
string) $tableview->getId()
186 $a_mapping->
addMapping(
'Services/COPage',
'pg',
'dclf:' . $a_rec[
'id'],
'dclf:' . $tableview->getId());
190 $new_table_id = (
int) $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
191 if ($new_table_id > 0) {
192 $datatype_id = (
int) $a_rec[
'datatype_id'];
193 $datatype = $a_rec[
'datatype_title'] ?? null;
197 foreach ($datatypes as $dt) {
198 if ($dt->getTitle() === $datatype) {
199 $datatype_id = $dt->getId();
203 if (in_array($datatype_id, array_keys($datatypes))) {
205 $field->setTableId($new_table_id);
206 $field->setDatatypeId($datatype_id);
207 $field->setTitle($a_rec[
'title']);
208 $field->setDescription($a_rec[
'description']);
209 $field->setUnique($a_rec[
'is_unique'] ===
'1');
211 $a_mapping->
addMapping(
'Modules/DataCollection',
'il_dcl_field', $a_rec[
'id'], $field->getId());
215 case 'il_dcl_tfield_set':
216 $new_table_id = (
int) $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
217 $new_field_id = is_numeric($a_rec[
'field']) ? $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $a_rec[
'field']) : $a_rec[
'field'];
218 if ($new_table_id > 0 && (is_string($new_field_id) || $new_field_id > 0)) {
223 $setting->setFieldOrder((
int) $a_rec[
'field_order']);
224 $setting->setExportable($a_rec[
'exportable'] ===
'1');
228 case 'il_dcl_tview_set':
230 'Modules/DataCollection',
232 $a_rec[
'tableview_id']
234 $new_field_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $a_rec[
'field']);
235 if ($new_tableview_id) {
237 $setting->setTableviewId((
int) $new_tableview_id);
238 $setting->setVisible($a_rec[
'visible'] ===
'1');
239 $setting->setField($new_field_id ?: $a_rec[
'field']);
240 $setting->setInFilter($a_rec[
'in_filter'] ===
'1');
241 $setting->setFilterValue($a_rec[
'filter_value']);
242 $setting->setFilterChangeable($a_rec[
'filter_changeable'] ===
'1');
243 $setting->setRequiredCreate($a_rec[
'required_create'] ===
'1');
244 $setting->setLockedCreate($a_rec[
'locked_create'] ===
'1');
245 $setting->setVisibleCreate($a_rec[
'visible_create'] ===
'1');
246 $setting->setVisibleEdit($a_rec[
'visible_edit'] ===
'1');
247 $setting->setRequiredEdit($a_rec[
'required_edit'] ===
'1');
248 $setting->setLockedEdit($a_rec[
'locked_edit'] ===
'1');
249 $setting->setDefaultValue($a_rec[
'default_value']);
252 'Modules/DataCollection',
255 (
string) $setting->getId()
259 case 'il_dcl_record':
260 $new_table_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
263 $record->setTableId((
int) $new_table_id);
267 $record->setOwner($this->
user->getId());
268 $record->setLastEditBy($this->
user->getId());
271 'Modules/DataCollection',
274 (
string) $record->getId()
279 $new_table_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
284 if ($a_rec[
'type'] == 0 && $a_rec[
'formtype'] == 0) {
289 'dclf:' . $a_rec[
'id'],
290 'dclf:' . $tableview->getId()
293 'Modules/DataCollection',
296 (
string) $tableview->getId()
300 'Modules/DataCollection',
303 json_encode([
'type' => $a_rec[
'type'],
304 'table_id' => $new_table_id,
305 'tableview_id' => $tableview->getId()
311 case 'il_dcl_viewdefinition':
312 $map = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_view', $a_rec[
'view_id']);
313 $new_field_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $a_rec[
'field']);
314 $field = ($new_field_id) ?: $a_rec[
'field'];
315 switch ($map[
'type']) {
318 $viewfield_setting->setVisible($a_rec[
'is_set']);
319 $viewfield_setting->store();
323 $viewfield_setting->setInFilter($a_rec[
'is_set']);
324 $viewfield_setting->store();
328 $tablefield_setting->setExportable($a_rec[
'is_set']);
329 $tablefield_setting->setFieldOrder($a_rec[
'field_order']);
330 $tablefield_setting->store();
334 case 'il_dcl_sel_opts':
335 $new_field_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
338 $opt->setFieldId((
int) $new_field_id);
339 $opt->setOptId((
int) $a_rec[
'opt_id']);
340 $opt->setSorting((
int) $a_rec[
'sorting']);
341 $opt->setValue($a_rec[
'value']);
345 case 'il_dcl_field_prop':
346 $new_field_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
349 $prop->setFieldId((
int) $new_field_id);
352 $name = $a_rec[
'name'];
353 if (!isset($name) && isset($a_rec[
'datatype_prop_id'])) {
360 6 =>
'reference_link',
363 9 =>
'learning_progress',
364 10 =>
'ILIAS_reference_link',
365 11 =>
'multiple_selection',
367 13 =>
'display_action_menu',
368 14 =>
'link_detail_page',
369 15 =>
'link_detail_page',
372 $name = $properties[$a_rec[
'datatype_prop_id']];
375 $prop->setName($name);
376 $prop->setValue($a_rec[
'value']);
379 'Modules/DataCollection',
382 (
string) $prop->getId()
384 $this->import_temp_refs_props[$prop->getId()] = $a_rec[
'value'];
387 case 'il_dcl_record_field':
388 $record_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_record', $a_rec[
'record_id']);
389 $field_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
390 if ($record_id && $field_id) {
395 'Modules/DataCollection',
396 'il_dcl_record_field',
398 (
string) $record_field->getId()
400 $this->import_record_field_cache[$record_field->getId()] = $record_field;
403 case 'il_dcl_stloc1_value':
404 case 'il_dcl_stloc2_value':
405 case 'il_dcl_stloc3_value':
406 $new_record_field_id = $a_mapping->
getMapping(
407 'Modules/DataCollection',
408 'il_dcl_record_field',
409 $a_rec[
'record_field_id']
411 if ($new_record_field_id) {
413 $record_field = $this->import_record_field_cache[$new_record_field_id];
414 if (is_object($record_field)) {
417 switch ($record_field->getField()->getDatatypeId()) {
420 $new_mob_id = $a_mapping->
getMapping(
'Services/MediaObjects',
'mob', $a_rec[
'value']);
421 $value = ($new_mob_id) ? (
int) $new_mob_id : null;
422 $this->import_temp_new_mob_ids[] = $new_mob_id;
425 $new_file_id = $a_mapping->
getMapping(
'Modules/File',
'file', $a_rec[
'value']);
426 $value = ($new_file_id) ? (
int) $new_file_id : null;
430 $value = $a_rec[
'value'];
431 $decode = json_decode($a_rec[
'value']);
432 if (is_array($decode)) {
433 foreach ($decode as
$id) {
434 $this->import_temp_refs[$new_record_field_id][] =
$id;
437 $this->import_temp_refs[$new_record_field_id] = $value;
444 $value = $a_rec[
'value'];
445 if ($value ==
'0000-00-00 00:00:00') {
450 if (version_compare($a_schema_version,
"8.13") < 0) {
451 $a_rec[
'value'] = str_replace(
'<br />',
'', $a_rec[
'value']);
455 $value = $a_rec[
'value'];
456 if ($a_entity ==
'il_dcl_stloc3_value' && empty($value)) {
460 $record_field->setValue($value,
true);
461 $record_field->doUpdate();
465 case 'il_dcl_stloc1_default':
466 case 'il_dcl_stloc2_default':
467 case 'il_dcl_stloc3_default':
470 'Modules/DataCollection',
472 $a_rec[
'tview_set_id']
476 $value = $a_rec[
'value'];
480 $value = (
int) $value;
482 $stloc_default->setValue($value);
483 $stloc_default->setTviewSetId((
int) $tview_set_id);
484 $stloc_default->create();
494 foreach ($array as
$key => $value) {
496 if (is_string(
$key)) {
497 $newkey = htmlspecialchars(
$key, ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8');
500 if (is_string($value)) {
501 $newvalue = htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8');
503 if (is_array($value)) {
506 $new[$newkey] = $newvalue;
517 foreach ($this->import_dc_object->getTables() as $table) {
518 if (is_numeric($table->getDefaultSortField())) {
519 $table->setDefaultSortField(
520 $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $table->getDefaultSortField())
525 foreach ($this->import_temp_new_mob_ids as $new_mob_id) {
530 foreach ($this->import_temp_refs as $record_field_id => $old_record_id) {
531 if (is_array($old_record_id)) {
533 foreach ($old_record_id as
$id) {
534 $new_record_id[] = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_record', $id);
536 $value = $new_record_id;
538 $value = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_record', $old_record_id);
541 $record_field = $this->import_record_field_cache[$record_field_id];
542 $record_field->setValue($value,
true);
543 $record_field->doUpdate();
545 foreach ($this->import_temp_refs_props as $field_prop_id => $prop_value) {
546 $new_field_id = $a_mapping->
getMapping(
'Modules/DataCollection',
'il_dcl_field', $prop_value);
547 $value = ($new_field_id) ? (
int) $new_field_id : $prop_value;
550 $field_prop->setValue($value);
551 $field_prop->update();
558 protected function getTypes(
string $a_entity,
string $a_version): array
565 "description" =>
"text",
566 'is_online' =>
'integer',
567 'rating' =>
'integer',
568 'public_notes' =>
'integer',
569 'approval' =>
'integer',
570 'notification' =>
'integer',
575 'obj_id' =>
'integer',
577 'add_perm' =>
'integer',
578 'edit_perm' =>
'integer',
579 'delete_perm' =>
'integer',
580 'edit_by_owner' =>
'integer',
581 'limited' =>
'integer',
582 'limit_start' =>
'text',
583 'limit_end' =>
'text',
584 'is_visible' =>
'integer',
585 'export_enabled' =>
'integer',
586 'import_enabled' =>
'integer',
587 'default_sort_field_id' =>
'text',
588 'default_sort_field_order' =>
'text',
589 'description' =>
'text',
590 'public_comments' =>
'integer',
591 'view_own_records_perm' =>
'integer',
592 'delete_by_owner' =>
'integer',
593 'save_confirmation' =>
'integer',
594 'table_order' =>
'integer',
596 case 'il_dcl_tableview':
599 'table_id' =>
'integer',
602 'description' =>
'text',
603 'tableview_order' =>
'integer',
608 'table_id' =>
'integer',
610 'description' =>
'text',
611 'datatype_id' =>
'integer',
612 'datatype_title' =>
'text',
613 'is_unique' =>
'integer',
615 case 'il_dcl_tview_set':
618 'tableview_id' =>
'integer',
620 'visible' =>
'integer',
621 'in_filter' =>
'integer',
622 'filter_value' =>
'text',
623 'filter_changeable' =>
'integer',
624 'required_create' =>
'integer',
625 'required_edit' =>
'integer',
626 'locked_create' =>
'integer',
627 'locked_edit' =>
'integer',
628 'visible_create' =>
'integer',
629 'visible_edit' =>
'integer',
630 'default_value' =>
'text',
632 case 'il_dcl_tfield_set':
635 'table_id' =>
'integer',
637 'field_order' =>
'integer',
638 'exportable' =>
'integer',
640 case 'il_dcl_field_prop':
643 'field_id' =>
'integer',
645 'value' =>
'integer',
647 case 'il_dcl_sel_opts':
650 'field_id' =>
'integer',
651 'opt_id' =>
'integer',
652 'sorting' =>
'integer',
655 case 'il_dcl_record':
658 'table_id' =>
'integer',
660 case 'il_dcl_record_field':
663 'record_id' =>
'integer',
664 'field_id' =>
'integer',
666 case 'il_dcl_stloc1_value':
667 case 'il_dcl_stloc2_value':
668 case 'il_dcl_stloc3_value':
671 'record_field_id' =>
'integer',
674 case 'il_dcl_stloc1_default':
675 case 'il_dcl_stloc2_default':
676 case 'il_dcl_stloc3_default':
679 'tview_set_id' =>
'integer',
698 ?array $a_rec = null,
701 if (!$a_rec && !$a_ids) {
706 $set = $this->db->query(
'SELECT * FROM il_dcl_table WHERE obj_id = ' . $this->db->quote(
710 $ids = $this->
buildCache(
'il_dcl_table', $set);
713 'il_dcl_table' => [
'ids' => $ids],
716 $set = $this->db->query(
'SELECT * FROM il_dcl_record WHERE table_id = ' . $this->db->quote(
720 $ids_records = $this->
buildCache(
'il_dcl_record', $set);
721 $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(
725 $ids_fields = $this->
buildCache(
'il_dcl_field', $set);
726 $set = $this->db->query(
'SELECT * FROM il_dcl_tableview WHERE table_id = ' . $this->db->quote(
730 $ids_tableviews = $this->
buildCache(
'il_dcl_tableview', $set);
731 $set = $this->db->query(
'SELECT * FROM il_dcl_tfield_set WHERE table_id = ' . $this->db->quote(
735 $ids_tablefield_settings = $this->
buildCache(
'il_dcl_tfield_set', $set);
738 'il_dcl_field' => [
'ids' => $ids_fields],
739 'il_dcl_record' => [
'ids' => $ids_records],
740 'il_dcl_tableview' => [
'ids' => $ids_tableviews],
741 'il_dcl_tfield_set' => [
'ids' => $ids_tablefield_settings],
744 $set = $this->db->query(
'SELECT * FROM il_dcl_field_prop WHERE field_id = ' . $this->db->quote(
748 $prop_ids = $this->
buildCache(
'il_dcl_field_prop', $set);
750 $set = $this->db->query(
'SELECT * FROM il_dcl_sel_opts WHERE field_id = ' . $this->db->quote(
754 $opt_ids = $this->
buildCache(
'il_dcl_sel_opts', $set);
757 'il_dcl_field_prop' => [
'ids' => $prop_ids],
758 'il_dcl_sel_opts' => [
'ids' => $opt_ids],
760 case 'il_dcl_record':
761 $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)' 762 .
' INNER JOIN il_dcl_datatype AS d ON (f.datatype_id = d.id) ' .
' WHERE rf.record_id = ' 763 . $this->db->quote($a_rec[
'id'],
'integer');
764 $set = $this->db->query($sql);
765 $ids = $this->
buildCache(
'il_dcl_record_field', $set);
767 $set = $this->db->query($sql);
768 while ($rec = $this->db->fetchObject($set)) {
773 =
'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 ' 774 .
'LEFT JOIN il_dcl_stloc1_value AS st1 ON (st1.record_field_id = rf.id) ' 775 .
'LEFT JOIN il_dcl_stloc2_value AS st2 ON (st2.record_field_id = rf.id) ' 776 .
'LEFT JOIN il_dcl_stloc3_value AS st3 ON (st3.record_field_id = rf.id) ' .
'WHERE rf.record_id = ' 777 . $this->db->quote($a_rec[
'id'],
'integer');
778 $set = $this->db->query($sql);
780 while ($rec = $this->db->fetchObject($set)) {
781 $stloc = $this->record_field_ids_2_storage[$rec->record_field_id];
784 $value =
"value$stloc";
785 $value = $rec->{$value};
788 $this->caches[
"il_dcl_stloc{$stloc}_value"][$rec->record_field_id] = [
789 'record_field_id' => $rec->record_field_id,
795 'il_dcl_record_field' => [
'ids' => $ids],
797 case 'il_dcl_tableview':
798 $set = $this->db->query(
'SELECT * FROM il_dcl_tview_set WHERE tableview_id = ' . $this->db->quote(
802 $ids = $this->
buildCache(
'il_dcl_tview_set', $set);
805 'il_dcl_tview_set' => [
'ids' => $ids],
807 case 'il_dcl_tview_set':
809 if (!(
int) $a_rec[
'field'] > 0) {
815 SELECT tview_set.id AS tview_set_id, st1.value AS value1, st2.value AS value2, st3.value AS value3, 816 st1.id AS id1, st2.id AS id2, st3.id AS id3 817 FROM il_dcl_tview_set AS tview_set 818 LEFT JOIN il_dcl_stloc1_default AS st1 ON (st1.tview_set_id = tview_set.id) 819 LEFT JOIN il_dcl_stloc2_default AS st2 ON (st2.tview_set_id = tview_set.id) 820 LEFT JOIN il_dcl_stloc3_default AS st3 ON (st3.tview_set_id = tview_set.id) 821 WHERE tview_set.id = ' . $this->db->quote($a_rec[
'id'],
'integer');
822 $set = $this->db->query($sql);
824 while ($rec = $this->db->fetchObject($set)) {
827 $value_str =
"value$stloc";
828 $value = $rec->{$value_str};
829 $id_str =
"id$stloc";
830 $id = $rec->{$id_str};
831 $tview_set_id = $rec->tview_set_id;
834 $this->caches[
"il_dcl_stloc" .
"$stloc" .
"_default"][$rec->tview_set_id] = [
836 'tview_set_id' => $rec->tview_set_id,
841 "il_dcl_stloc{$stloc}_default" => [
'ids' => [$tview_set_id]],
846 case 'il_dcl_record_field':
847 $record_field_id = $a_rec[
'id'];
848 $storage_loc = $this->record_field_ids_2_storage[$record_field_id];
851 "il_dcl_stloc{$storage_loc}_value" => [
'ids' => [$record_field_id]],
862 public function readData(
string $a_entity,
string $a_version, array $a_ids): void
873 protected function _readData(
string $a_entity, array $a_ids): void
877 foreach ($a_ids as $dcl_id) {
882 'title' => $obj->getTitle(),
883 'description' => $obj->getDescription(),
884 'is_online' => $obj->getOnline() ?
'1' :
'0',
885 'rating' => $obj->getRating() ?
'1' :
'0',
886 'public_notes' => $obj->getPublicNotes() ?
'1' :
'0',
887 'approval' => $obj->getApproval() ?
'1' :
'0',
888 'notification' => $obj->getNotification() ?
'1' :
'0',
890 $this->caches[
'dcl'][$dcl_id] =
$data;
891 $this->data[] =
$data;
897 foreach ($a_ids as
$id) {
905 $fields = array_keys($this->
getTypes($a_entity,
''));
907 while ($rec = $this->db->fetchObject($set)) {
909 foreach ($fields as $field) {
910 $data[$field] = $rec->{$field};
913 $this->caches[$a_entity][
$id] =
$data;
getXmlNamespace(string $a_entity, string $a_schema_version)
static createOrGetStandardView(int $table_id)
getTypes(string $a_entity, string $a_version)
Map XML attributes of entities to datatypes (text, integer...)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static returnDbTableName()
buildCache(string $a_entity, ilDBStatement $set)
static getFieldCache(int $field_id=0)
const INPUTFORMAT_REFERENCELIST
static isPluginDatatype(string $datatype)
array $import_record_field_cache
Caches ilDclBaseRecordFieldModel objects.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
static getInstance(int $tableview_id, int $field_id)
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
getMapping(string $a_comp, string $a_entity, string $a_old_id)
readData(string $a_entity, string $a_version, array $a_ids)
Read data from Cache for a given entity and ID(s)
static getAllDatatype(bool $force=false)
Get all possible Datatypes.
getCache(string $a_entity)
Get cached data from a given entity.
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.
array $import_temp_new_mob_ids
const INPUTFORMAT_ILIAS_REF
array ilObjDataCollection $import_dc_object
_readData(string $a_entity, array $a_ids)
Build data array, data is read from cache except dcl object itself.
static getInstance(int $table_id, string $field)
const INPUTFORMAT_REFERENCE
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static getRecordCache(?int $record_id)
const INPUTFORMAT_FILEUPLOAD
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) ...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
escapeArray(array $array)
array $import_temp_refs_props
array $record_field_ids_2_storage
static _lookupType(int $id, bool $reference=false)