ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilOrgUnitImporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 require_once("./Services/Export/classes/class.ilXmlImporter.php");
12 
14  public $errors;
15 
17  public $warnings;
18 
20  public $stats;
21 
22 
23  protected function buildRef($id, $type){
24  if($type == "reference_id")
25  {
26  if(!ilObjOrgUnit::_exists($id, true))
27  {
28  return false;
29  }
30  return $id;
31  }
32  elseif($type == "external_id")
33  {
34  $obj_id = ilObject::_lookupObjIdByImportId($id);
35  $ref_ids = ilObject::_getAllReferences($obj_id);
36  if(!count($ref_ids))
37  {
38  return false;
39  }
40  if(count($ref_ids))
41  {
42  return array_shift($ref_ids);
43  }
44  }
45  else
46  {
47  return false;
48  }
49  }
50 
51  public function hasErrors(){
52  return count($this->errors)!=0;
53  }
54 
55  public function hasWarnings(){
56  return count($this->warnings)!=0;
57  }
58 
59  public function addWarning($lang_var, $import_id, $action = null){
60  $this->warnings[] = array("lang_var" => $lang_var, "import_id" => $import_id, "action" => $action);
61  }
62 
63  public function addError($lang_var, $import_id, $action = null){
64  $this->errors[] = array("lang_var" => $lang_var, "import_id" => $import_id, "action" => $action);
65  }
66 
70  public function getErrors()
71  {
72  return $this->errors;
73  }
74 
78  public function getWarnings()
79  {
80  return $this->warnings;
81  }
82 
86  public function getStats()
87  {
88  return $this->stats;
89  }
90 
97  function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
98  {
99 
100  }
101 }
102 ?>
addWarning($lang_var, $import_id, $action=null)
addError($lang_var, $import_id, $action=null)
static _getAllReferences($a_id)
get all reference ids of object
static _exists($a_id, $a_reference=false)
Class ilOrgUnitImporter.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
static _lookupObjIdByImportId($a_import_id)
Xml importer class.