ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilUserImporter.php
Go to the documentation of this file.
1<?php
2
24{
25 protected ilUserDataSet $ds;
26
27 public function init(): void
28 {
29 $this->ds = new ilUserDataSet();
30 $this->ds->setDSPrefix("ds");
31 $this->ds->setImportDirectory($this->getImportDirectory());
32 }
33
34 public function importXmlRepresentation(
35 string $a_entity,
36 string $a_id,
37 string $a_xml,
38 ilImportMapping $a_mapping
39 ): void {
41 $a_entity,
42 $this->getSchemaVersion(),
43 $a_xml,
44 $this->ds,
45 $a_mapping
46 );
47 }
48
49 public function finalProcessing(ilImportMapping $a_mapping): void
50 {
51 if (is_array($this->ds->multi)) {
52 foreach ($this->ds->multi as $usr_id => $values) {
53 $usr_obj = new ilObjUser($usr_id);
54
55 if (isset($values["interests_general"])) {
56 $usr_obj->setGeneralInterests($values["interests_general"]);
57 } else {
58 $usr_obj->setGeneralInterests();
59 }
60 if (isset($values["interests_help_offered"])) {
61 $usr_obj->setOfferingHelp($values["interests_help_offered"]);
62 } else {
63 $usr_obj->setOfferingHelp();
64 }
65 if (isset($values["interests_help_looking"])) {
66 $usr_obj->setLookingForHelp($values["interests_help_looking"]);
67 } else {
68 $usr_obj->setLookingForHelp();
69 }
70
71 $usr_obj->update();
72 }
73 }
74 }
75}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
finalProcessing(ilImportMapping $a_mapping)
Xml importer class.