ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilUserImporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Export/classes/class.ilXmlImporter.php");
5
14{
15
19 public function init()
20 {
21 include_once("./Services/User/classes/class.ilUserDataSet.php");
22 $this->ds = new ilUserDataSet();
23 $this->ds->setDSPrefix("ds");
24 $this->ds->setImportDirectory($this->getImportDirectory());
25 }
26
27
34 public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
35 {
36 include_once("./Services/DataSet/classes/class.ilDataSetImportParser.php");
38 $a_entity,
39 $this->getSchemaVersion(),
40 $a_xml,
41 $this->ds,
42 $a_mapping
43 );
44 }
45
46 public function finalProcessing($a_mapping)
47 {
48 if (is_array($this->ds->multi)) {
49 foreach ($this->ds->multi as $usr_id => $values) {
50 $usr_obj = new ilObjUser($usr_id);
51
52 if (isset($values["interests_general"])) {
53 $usr_obj->setGeneralInterests($values["interests_general"]);
54 } else {
55 $usr_obj->setGeneralInterests();
56 }
57 if (isset($values["interests_help_offered"])) {
58 $usr_obj->setOfferingHelp($values["interests_help_offered"]);
59 } else {
60 $usr_obj->setOfferingHelp();
61 }
62 if (isset($values["interests_help_looking"])) {
63 $usr_obj->setLookingForHelp($values["interests_help_looking"]);
64 } else {
65 $usr_obj->setLookingForHelp();
66 }
67
68 $usr_obj->updateMultiTextFields();
69 }
70 }
71 }
72}
$parser
Definition: BPMN2Parser.php:23
An exception for terminatinating execution or to throw for unit testing.
Manifest parser for ILIAS standard export files.
Exercise data set class.
Importer class for user data.
finalProcessing($a_mapping)
Final processing.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
init()
Initialisation.
Xml importer class.
getSchemaVersion()
Get schema version.
getImportDirectory()
Get import directory.