ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilUserExporter.php
Go to the documentation of this file.
1 <?php
2 
27 {
29  private ilUserDataSet $ds;
30 
31  public function init(): void
32  {
33  $this->ds = new ilUserDataSet();
34  $this->ds->initByExporter($this);
35  $this->ds->setDSPrefix("ds");
37  $config = $this->exp->getExportConfigs()->getElementByClassName('ilUserExportConfig');
38  $this->export_config = $config;
39  }
40 
41  public function getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids): array // Missing array type.
42  {
43  if ($a_entity === 'usr' && $this->export_config->getExportType() === 'personal_data') {
44  $cal_ids = [];
45  foreach ($a_ids as $user_id) {
46  foreach (ilCalendarCategories::lookupPrivateCategories($user_id) as $ct) {
47  $cal_ids[] = $ct["cat_id"];
48  }
49  }
50 
51  return [
52  [
53  "component" => "components/ILIAS/User",
54  "entity" => "usr_profile",
55  "ids" => $a_ids],
56  [
57  "component" => "components/ILIAS/User",
58  "entity" => "usr_multi",
59  "ids" => $a_ids],
60  [
61  "component" => "components/ILIAS/User",
62  "entity" => "usr_setting",
63  "ids" => $a_ids],
64  [
65  "component" => "components/ILIAS/Notes",
66  "entity" => "user_notes",
67  "ids" => $a_ids],
68  [
69  "component" => "components/ILIAS/Calendar",
70  "entity" => "calendar",
71  "ids" => $cal_ids]
72  ];
73  }
74 
75  return parent::getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids);
76  }
77 
78  public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string
79  {
80  $this->ds->initByExporter($this);
81  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
82  }
83 
84  public function getValidSchemaVersions(string $a_entity): array // Missing array type.
85  {
86  return [
87  "4.3.0" => [
88  "namespace" => "https://www.ilias.de/Services/User/usr/4_3",
89  "xsd_file" => "ilias_usr_4_3.xsd",
90  "uses_dataset" => true,
91  "min" => "4.3.0",
92  "max" => "4.4.99"],
93  "5.1.0" => [
94  "namespace" => "https://www.ilias.de/Services/User/usr/5_1",
95  "xsd_file" => "ilias_usr_5_1.xsd",
96  "uses_dataset" => true,
97  "min" => "5.1.0",
98  "max" => "5.1.99"],
99  "5.2.0" => [
100  "namespace" => "https://www.ilias.de/Services/User/usr/5_2",
101  "xsd_file" => "ilias_usr_5_2.xsd",
102  "uses_dataset" => true,
103  "min" => "5.2.0",
104  "max" => "5.2.99"],
105  "5.3.0" => [
106  "namespace" => "https://www.ilias.de/Services/User/usr/5_3",
107  "xsd_file" => "ilias_usr_5_3.xsd",
108  "uses_dataset" => true,
109  "min" => "5.3.0",
110  "max" => ""]
111  ];
112  }
113 }
static lookupPrivateCategories(int $a_user_id)
Lookup private categories of user.
getValidSchemaVersions(string $a_entity)
ilUserExportConfig $export_config
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
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...
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)