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' => [],
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 $tableview->setTableviewOrder((
int) $a_rec[
'tableview_order']);
180 if (!is_array($a_rec[
'roles'])) {
181 $a_rec[
'roles'] = json_decode($a_rec[
'roles']);
183 $tableview->setRoles($a_rec[
'roles']);
184 $tableview->create(
false);
187 'components/ILIAS/DataCollection',
190 (
string) $tableview->getId()
192 $a_mapping->
addMapping(
'components/ILIAS/COPage',
'pg',
'dclf:' . $a_rec[
'id'],
'dclf:' . $tableview->getId());
196 $new_table_id = (
int) $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
197 if ($new_table_id > 0) {
198 $datatype_id = (
int) $a_rec[
'datatype_id'];
199 $datatype = $a_rec[
'datatype_title'] ??
null;
203 foreach ($datatypes as $dt) {
204 if ($dt->getTitle() === $datatype) {
205 $datatype_id = $dt->getId();
209 if (in_array($datatype_id, array_keys($datatypes))) {
211 $field->setTableId($new_table_id);
212 $field->setDatatypeId($datatype_id);
213 $field->setTitle($a_rec[
'title']);
214 $field->setDescription($a_rec[
'description']);
216 $a_mapping->
addMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'id'], $field->getId());
220 case 'il_dcl_tfield_set':
221 $new_table_id = (
int) $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
222 $new_field_id = is_numeric($a_rec[
'field']) ? $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field']) : $a_rec[
'field'];
223 if ($new_table_id > 0 && (is_string($new_field_id) || $new_field_id > 0)) {
228 $setting->setFieldOrder((
int) $a_rec[
'field_order']);
229 $setting->setExportable($a_rec[
'exportable'] ===
'1');
233 case 'il_dcl_tview_set':
235 'components/ILIAS/DataCollection',
237 $a_rec[
'tableview_id']
239 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field']);
240 if ($new_tableview_id) {
242 $setting->setTableviewId((
int) $new_tableview_id);
243 $setting->setVisible($a_rec[
'visible'] ===
'1');
244 $setting->setField($new_field_id ?: $a_rec[
'field']);
245 $setting->setInFilter($a_rec[
'in_filter'] ===
'1');
246 $setting->setFilterValue($a_rec[
'filter_value']);
247 $setting->setFilterChangeable($a_rec[
'filter_changeable'] ===
'1');
248 $setting->setRequiredCreate($a_rec[
'required_create'] ===
'1');
249 $setting->setLockedCreate($a_rec[
'locked_create'] ===
'1');
250 $setting->setVisibleCreate($a_rec[
'visible_create'] ===
'1');
251 $setting->setVisibleEdit($a_rec[
'visible_edit'] ===
'1');
252 $setting->setRequiredEdit($a_rec[
'required_edit'] ===
'1');
253 $setting->setLockedEdit($a_rec[
'locked_edit'] ===
'1');
254 $setting->setDefaultValue($a_rec[
'default_value']);
257 'components/ILIAS/DataCollection',
260 (
string) $setting->getId()
264 case 'il_dcl_record':
265 $new_table_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
268 $record->setTableId((
int) $new_table_id);
272 $record->setOwner($this->
user->getId());
273 $record->setLastEditBy($this->
user->getId());
276 'components/ILIAS/DataCollection',
279 (
string) $record->getId()
284 $new_table_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_table', $a_rec[
'table_id']);
289 if ($a_rec[
'type'] == 0 && $a_rec[
'formtype'] == 0) {
292 'components/ILIAS/COPage',
294 'dclf:' . $a_rec[
'id'],
295 'dclf:' . $tableview->getId()
298 'components/ILIAS/DataCollection',
301 (
string) $tableview->getId()
305 'components/ILIAS/DataCollection',
308 json_encode([
'type' => $a_rec[
'type'],
309 'table_id' => $new_table_id,
310 'tableview_id' => $tableview->getId()
316 case 'il_dcl_viewdefinition':
317 $map = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_view', $a_rec[
'view_id']);
318 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field']);
319 $field = ($new_field_id) ?: $a_rec[
'field'];
320 switch ($map[
'type']) {
323 $viewfield_setting->setVisible($a_rec[
'is_set']);
324 $viewfield_setting->store();
328 $viewfield_setting->setInFilter($a_rec[
'is_set']);
329 $viewfield_setting->store();
333 $tablefield_setting->setExportable($a_rec[
'is_set']);
334 $tablefield_setting->setFieldOrder($a_rec[
'field_order']);
335 $tablefield_setting->store();
339 case 'il_dcl_sel_opts':
340 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
343 $opt->setFieldId((
int) $new_field_id);
344 $opt->setOptId((
int) $a_rec[
'opt_id']);
345 $opt->setSorting((
int) $a_rec[
'sorting']);
346 $opt->setValue($a_rec[
'value']);
350 case 'il_dcl_field_prop':
351 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
354 $prop->setFieldId((
int) $new_field_id);
357 $name = $a_rec[
'name'];
358 if (!isset($name) && isset($a_rec[
'datatype_prop_id'])) {
364 5 =>
'reference_link',
367 8 =>
'learning_progress',
368 9 =>
'ILIAS_reference_link',
369 10 =>
'multiple_selection',
371 12 =>
'display_action_menu',
372 13 =>
'link_detail_page',
373 14 =>
'link_detail_page',
376 $name = $properties[$a_rec[
'datatype_prop_id']];
379 $prop->setName($name);
380 $prop->setValue($a_rec[
'value']);
383 'components/ILIAS/DataCollection',
386 (
string) $prop->getId()
388 $this->import_temp_refs_props[$prop->getId()] = $a_rec[
'value'];
391 case 'il_dcl_record_field':
392 $record_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_record', $a_rec[
'record_id']);
393 $field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $a_rec[
'field_id']);
394 if ($record_id && $field_id) {
399 'components/ILIAS/DataCollection',
400 'il_dcl_record_field',
402 (
string) $record_field->getId()
404 $this->import_record_field_cache[$record_field->getId()] = $record_field;
407 case 'il_dcl_stloc1_value':
408 case 'il_dcl_stloc2_value':
409 case 'il_dcl_stloc3_value':
410 $new_record_field_id = $a_mapping->
getMapping(
411 'components/ILIAS/DataCollection',
412 'il_dcl_record_field',
413 $a_rec[
'record_field_id']
415 if ($new_record_field_id) {
417 $record_field = $this->import_record_field_cache[$new_record_field_id];
418 if (is_object($record_field)) {
421 switch ($record_field->getField()->getDatatypeId()) {
424 $new_mob_id = $a_mapping->
getMapping(
'components/ILIAS/MediaObjects',
'mob', $a_rec[
'value']);
425 $value = ($new_mob_id) ? (
int) $new_mob_id :
null;
426 $this->import_temp_new_mob_ids[] = $new_mob_id;
429 $new_file_id = $a_mapping->
getMapping(
'components/ILIAS/File',
'file', $a_rec[
'value']);
430 $value = ($new_file_id) ? (
int) $new_file_id :
null;
434 $value = $a_rec[
'value'];
435 $decode = json_decode($a_rec[
'value']);
436 if (is_array($decode)) {
437 foreach ($decode as
$id) {
438 $this->import_temp_refs[$new_record_field_id][] =
$id;
441 $this->import_temp_refs[$new_record_field_id] = $value;
449 $value = $a_rec[
'value'];
450 if ($value ==
'0000-00-00 00:00:00') {
455 if (version_compare($a_schema_version,
"8.13") < 0) {
456 $a_rec[
'value'] = str_replace(
'<br />',
'', $a_rec[
'value']);
460 $value = $a_rec[
'value'];
461 if ($a_entity ==
'il_dcl_stloc3_value' && empty($value)) {
465 $record_field->setValue($value,
true);
466 $record_field->doUpdate();
470 case 'il_dcl_stloc1_default':
471 case 'il_dcl_stloc2_default':
472 case 'il_dcl_stloc3_default':
475 'components/ILIAS/DataCollection',
477 $a_rec[
'tview_set_id']
481 $value = $a_rec[
'value'];
485 $value = (
int) $value;
487 $stloc_default->setValue($value);
488 $stloc_default->setTviewSetId((
int) $tview_set_id);
489 $stloc_default->create();
499 foreach ($array as $key => $value) {
501 if (is_string($key)) {
502 $newkey = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform($key);
505 if (is_string($value)) {
506 $newvalue = $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform($value);
508 if (is_array($value)) {
511 $new[$newkey] = $newvalue;
522 foreach ($this->import_dc_object->getTables() as $table) {
523 if (is_numeric($table->getDefaultSortField())) {
524 $table->setDefaultSortField(
525 $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $table->getDefaultSortField())
530 foreach ($this->import_temp_new_mob_ids as $new_mob_id) {
535 foreach ($this->import_temp_refs as $record_field_id => $old_record_id) {
536 if (is_array($old_record_id)) {
538 foreach ($old_record_id as
$id) {
539 $new_record_id[] = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_record', $id);
541 $value = $new_record_id;
543 $value = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_record', $old_record_id);
546 $record_field = $this->import_record_field_cache[$record_field_id];
547 $record_field->setValue($value,
true);
548 $record_field->doUpdate();
550 foreach ($this->import_temp_refs_props as $field_prop_id => $prop_value) {
551 $new_field_id = $a_mapping->
getMapping(
'components/ILIAS/DataCollection',
'il_dcl_field', $prop_value);
552 $value = ($new_field_id) ? (
int) $new_field_id : $prop_value;
555 $field_prop->setValue($value);
556 $field_prop->update();
563 protected function getTypes(
string $a_entity,
string $a_version): array
570 "description" =>
"text",
571 'is_online' =>
'integer',
572 'rating' =>
'integer',
573 'public_notes' =>
'integer',
574 'approval' =>
'integer',
575 'notification' =>
'integer',
580 'obj_id' =>
'integer',
582 'add_perm' =>
'integer',
583 'edit_perm' =>
'integer',
584 'delete_perm' =>
'integer',
585 'edit_by_owner' =>
'integer',
586 'limited' =>
'integer',
587 'limit_start' =>
'text',
588 'limit_end' =>
'text',
589 'is_visible' =>
'integer',
590 'export_enabled' =>
'integer',
591 'import_enabled' =>
'integer',
592 'default_sort_field_id' =>
'text',
593 'default_sort_field_order' =>
'text',
594 'description' =>
'text',
595 'public_comments' =>
'integer',
596 'view_own_records_perm' =>
'integer',
597 'delete_by_owner' =>
'integer',
598 'save_confirmation' =>
'integer',
599 'table_order' =>
'integer',
601 case 'il_dcl_tableview':
604 'table_id' =>
'integer',
607 'description' =>
'text',
608 'tableview_order' =>
'integer',
613 'table_id' =>
'integer',
615 'description' =>
'text',
616 'datatype_id' =>
'integer',
617 'datatype_title' =>
'text',
619 case 'il_dcl_tview_set':
622 'tableview_id' =>
'integer',
624 'visible' =>
'integer',
625 'in_filter' =>
'integer',
626 'filter_value' =>
'text',
627 'filter_changeable' =>
'integer',
628 'required_create' =>
'integer',
629 'required_edit' =>
'integer',
630 'locked_create' =>
'integer',
631 'locked_edit' =>
'integer',
632 'visible_create' =>
'integer',
633 'visible_edit' =>
'integer',
634 'default_value' =>
'text',
636 case 'il_dcl_tfield_set':
639 'table_id' =>
'integer',
641 'field_order' =>
'integer',
642 'exportable' =>
'integer',
644 case 'il_dcl_field_prop':
647 'field_id' =>
'integer',
649 'value' =>
'integer',
651 case 'il_dcl_sel_opts':
654 'field_id' =>
'integer',
655 'opt_id' =>
'integer',
656 'sorting' =>
'integer',
659 case 'il_dcl_record':
662 'table_id' =>
'integer',
664 case 'il_dcl_record_field':
667 'record_id' =>
'integer',
668 'field_id' =>
'integer',
670 case 'il_dcl_stloc1_value':
671 case 'il_dcl_stloc2_value':
672 case 'il_dcl_stloc3_value':
675 'record_field_id' =>
'integer',
678 case 'il_dcl_stloc1_default':
679 case 'il_dcl_stloc2_default':
680 case 'il_dcl_stloc3_default':
683 'tview_set_id' =>
'integer',
702 ?array $a_rec =
null,
705 if (!$a_rec && !$a_ids) {
710 $set = $this->db->query(
'SELECT * FROM il_dcl_table WHERE obj_id = ' . $this->db->quote(
714 $ids = $this->
buildCache(
'il_dcl_table', $set);
717 'il_dcl_table' => [
'ids' => $ids],
720 $set = $this->db->query(
'SELECT * FROM il_dcl_record WHERE table_id = ' . $this->db->quote(
724 $ids_records = $this->
buildCache(
'il_dcl_record', $set);
725 $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(
729 $ids_fields = $this->
buildCache(
'il_dcl_field', $set);
730 $set = $this->db->query(
'SELECT * FROM il_dcl_tableview WHERE table_id = ' . $this->db->quote(
734 $ids_tableviews = $this->
buildCache(
'il_dcl_tableview', $set);
735 $set = $this->db->query(
'SELECT * FROM il_dcl_tfield_set WHERE table_id = ' . $this->db->quote(
739 $ids_tablefield_settings = $this->
buildCache(
'il_dcl_tfield_set', $set);
742 'il_dcl_field' => [
'ids' => $ids_fields],
743 'il_dcl_record' => [
'ids' => $ids_records],
744 'il_dcl_tableview' => [
'ids' => $ids_tableviews],
745 'il_dcl_tfield_set' => [
'ids' => $ids_tablefield_settings],
748 $set = $this->db->query(
'SELECT * FROM il_dcl_field_prop WHERE field_id = ' . $this->db->quote(
752 $prop_ids = $this->
buildCache(
'il_dcl_field_prop', $set);
754 $set = $this->db->query(
'SELECT * FROM il_dcl_sel_opts WHERE field_id = ' . $this->db->quote(
758 $opt_ids = $this->
buildCache(
'il_dcl_sel_opts', $set);
761 'il_dcl_field_prop' => [
'ids' => $prop_ids],
762 'il_dcl_sel_opts' => [
'ids' => $opt_ids],
764 case 'il_dcl_record':
765 $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)' 766 .
' INNER JOIN il_dcl_datatype AS d ON (f.datatype_id = d.id) ' .
' WHERE rf.record_id = ' 767 . $this->db->quote($a_rec[
'id'],
'integer');
768 $set = $this->db->query($sql);
769 $ids = $this->
buildCache(
'il_dcl_record_field', $set);
771 $set = $this->db->query($sql);
772 while ($rec = $this->db->fetchObject($set)) {
777 =
'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 ' 778 .
'LEFT JOIN il_dcl_stloc1_value AS st1 ON (st1.record_field_id = rf.id) ' 779 .
'LEFT JOIN il_dcl_stloc2_value AS st2 ON (st2.record_field_id = rf.id) ' 780 .
'LEFT JOIN il_dcl_stloc3_value AS st3 ON (st3.record_field_id = rf.id) ' .
'WHERE rf.record_id = ' 781 . $this->db->quote($a_rec[
'id'],
'integer');
782 $set = $this->db->query($sql);
784 while ($rec = $this->db->fetchObject($set)) {
785 $stloc = $this->record_field_ids_2_storage[$rec->record_field_id];
788 $value =
"value$stloc";
789 $value = $rec->{$value};
792 $this->caches[
"il_dcl_stloc{$stloc}_value"][$rec->record_field_id] = [
793 'record_field_id' => $rec->record_field_id,
799 'il_dcl_record_field' => [
'ids' => $ids],
801 case 'il_dcl_tableview':
802 $set = $this->db->query(
'SELECT * FROM il_dcl_tview_set WHERE tableview_id = ' . $this->db->quote(
806 $ids = $this->
buildCache(
'il_dcl_tview_set', $set);
809 'il_dcl_tview_set' => [
'ids' => $ids],
811 case 'il_dcl_tview_set':
813 if (!(
int) $a_rec[
'field'] > 0) {
819 SELECT tview_set.id AS tview_set_id, st1.value AS value1, st2.value AS value2, st3.value AS value3, 820 st1.id AS id1, st2.id AS id2, st3.id AS id3 821 FROM il_dcl_tview_set AS tview_set 822 LEFT JOIN il_dcl_stloc1_default AS st1 ON (st1.tview_set_id = tview_set.id) 823 LEFT JOIN il_dcl_stloc2_default AS st2 ON (st2.tview_set_id = tview_set.id) 824 LEFT JOIN il_dcl_stloc3_default AS st3 ON (st3.tview_set_id = tview_set.id) 825 WHERE tview_set.id = ' . $this->db->quote($a_rec[
'id'],
'integer');
826 $set = $this->db->query($sql);
828 while ($rec = $this->db->fetchObject($set)) {
831 $value_str =
"value$stloc";
832 $value = $rec->{$value_str};
833 $id_str =
"id$stloc";
834 $id = $rec->{$id_str};
835 $tview_set_id = $rec->tview_set_id;
838 $this->caches[
"il_dcl_stloc" .
"$stloc" .
"_default"][$rec->tview_set_id] = [
840 'tview_set_id' => $rec->tview_set_id,
845 "il_dcl_stloc{$stloc}_default" => [
'ids' => [$tview_set_id]],
850 case 'il_dcl_record_field':
851 $record_field_id = $a_rec[
'id'];
852 $storage_loc = $this->record_field_ids_2_storage[$record_field_id];
855 "il_dcl_stloc{$storage_loc}_value" => [
'ids' => [$record_field_id]],
866 public function readData(
string $a_entity,
string $a_version, array $a_ids): void
877 protected function _readData(
string $a_entity, array $a_ids): void
881 foreach ($a_ids as $dcl_id) {
886 'title' => $obj->getTitle(),
887 'description' => $obj->getDescription(),
888 'is_online' => $obj->getOnline() ?
'1' :
'0',
889 'rating' => $obj->getRating() ?
'1' :
'0',
890 'public_notes' => $obj->getPublicNotes() ?
'1' :
'0',
891 'approval' => $obj->getApproval() ?
'1' :
'0',
892 'notification' => $obj->getNotification() ?
'1' :
'0',
894 $this->caches[
'dcl'][$dcl_id] =
$data;
895 $this->data[] =
$data;
901 foreach ($a_ids as
$id) {
909 $fields = array_keys($this->
getTypes($a_entity,
''));
911 while ($rec = $this->db->fetchObject($set)) {
913 foreach ($fields as $field) {
914 $data[$field] = $rec->{$field};
917 $this->caches[$a_entity][
$id] =
$data;
ILIAS Refinery Factory $refinery
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...)
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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getInstance(int $tableview_id, int $field_id)
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_DATETIME
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
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
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) ...
escapeArray(array $array)
array $import_temp_refs_props
array $record_field_ids_2_storage
static _lookupType(int $id, bool $reference=false)