ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilOrgUnitImporter Class Reference

Class ilOrgUnitImporter. More...

+ Inheritance diagram for ilOrgUnitImporter:
+ Collaboration diagram for ilOrgUnitImporter:

Public Member Functions

 hasErrors ()
 
 hasWarnings ()
 
 addWarning ($lang_var, $import_id, $action=null)
 
 addError ($lang_var, $import_id, $action=null)
 
 getErrors ()
 
 getWarnings ()
 
 getStats ()
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor. More...
 
 setImport ($a_val)
 Set import. More...
 
 getImport ()
 Get import. More...
 
 init ()
 Init. More...
 
 setInstallId ($a_val)
 Set installation id. More...
 
 getInstallId ()
 Get installation id. More...
 
 setInstallUrl ($a_val)
 Set installation url. More...
 
 getInstallUrl ()
 Get installation url. More...
 
 setSchemaVersion ($a_val)
 Set schema version. More...
 
 getSchemaVersion ()
 Get schema version. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setSkipEntities ($a_val)
 Set skip entities. More...
 
 getSkipEntities ()
 Get skip entities. More...
 
 exportedFromSameInstallation ()
 Is exporting and importing installation identical? More...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import xml representation. More...
 
 finalProcessing ($a_mapping)
 Final processing. More...
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 Called after all container objects have been implemented. More...
 

Data Fields

 $errors
 
 $warnings
 
 $stats
 

Protected Member Functions

 buildRef ($id, $type)
 

Additional Inherited Members

- Protected Attributes inherited from ilXmlImporter
 $skip_entities = array()
 
 $imp
 

Detailed Description

Member Function Documentation

◆ addError()

ilOrgUnitImporter::addError (   $lang_var,
  $import_id,
  $action = null 
)
Parameters
$lang_var
$import_id
null$action

Definition at line 101 of file class.ilOrgUnitImporter.php.

References $action, and array.

Referenced by ilOrgUnitSimpleImport\simpleImport(), ilOrgUnitSimpleImport\simpleImportElement(), ilOrgUnitSimpleUserImport\simpleUserImport(), and ilOrgUnitSimpleUserImport\simpleUserImportElement().

102  {
103  $this->errors[] = array( 'lang_var' => $lang_var, 'import_id' => $import_id, 'action' => $action );
104  }
$action
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addWarning()

ilOrgUnitImporter::addWarning (   $lang_var,
  $import_id,
  $action = null 
)
Parameters
$lang_var
$import_id
null$action

Definition at line 90 of file class.ilOrgUnitImporter.php.

References $action, and array.

Referenced by ilOrgUnitSimpleImport\moveObject(), and ilOrgUnitSimpleImport\simpleImportElement().

91  {
92  $this->warnings[] = array( 'lang_var' => $lang_var, 'import_id' => $import_id, 'action' => $action );
93  }
$action
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ buildRef()

ilOrgUnitImporter::buildRef (   $id,
  $type 
)
protected
Parameters
$id
$type
Returns
bool|int

Definition at line 34 of file class.ilOrgUnitImporter.php.

References $id, $type, ilObjOrgUnit\_exists(), ilObject\_getAllReferences(), ilObject\_hasUntrashedReference(), ilObject\_isInTrash(), and ilObject\_lookupObjIdByImportId().

Referenced by ilOrgUnitSimpleImport\simpleImportElement(), and ilOrgUnitSimpleUserImport\simpleUserImportElement().

35  {
36  if ($type == 'reference_id') {
37  if (!ilObjOrgUnit::_exists($id, true)) {
38  return false;
39  }
40 
41  return $id;
42  } elseif ($type == 'external_id') {
44 
45  if (!ilObject::_hasUntrashedReference($obj_id)) {
46  return false;
47  }
48 
49  $ref_ids = ilObject::_getAllReferences($obj_id);
50 
51  if (!count($ref_ids)) {
52  return false;
53  }
54 
55  foreach ($ref_ids as $ref_id) {
56  if (!ilObject::_isInTrash($ref_id)) {
57  return $ref_id;
58  }
59  }
60  return false;
61  } else {
62  return false;
63  }
64  }
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
$type
if(!array_key_exists('StateId', $_REQUEST)) $id
static _exists($a_id, $a_reference=false, $type="orgu")
static _isInTrash($a_ref_id)
checks wether object is in trash
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjIdByImportId($a_import_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getErrors()

ilOrgUnitImporter::getErrors ( )
Returns
array

Definition at line 110 of file class.ilOrgUnitImporter.php.

References $errors.

111  {
112  return $this->errors;
113  }

◆ getStats()

ilOrgUnitImporter::getStats ( )
Returns
array

Definition at line 128 of file class.ilOrgUnitImporter.php.

References $stats.

129  {
130  return $this->stats;
131  }

◆ getWarnings()

ilOrgUnitImporter::getWarnings ( )
Returns
array

Definition at line 119 of file class.ilOrgUnitImporter.php.

References $warnings.

120  {
121  return $this->warnings;
122  }

◆ hasErrors()

ilOrgUnitImporter::hasErrors ( )
Returns
bool

Definition at line 70 of file class.ilOrgUnitImporter.php.

71  {
72  return count($this->errors) != 0;
73  }

◆ hasWarnings()

ilOrgUnitImporter::hasWarnings ( )
Returns
bool

Definition at line 79 of file class.ilOrgUnitImporter.php.

80  {
81  return count($this->warnings) != 0;
82  }

◆ importXmlRepresentation()

ilOrgUnitImporter::importXmlRepresentation (   $a_entity,
  $a_id,
  $a_xml,
  $a_mapping 
)
Parameters
$a_entity
$a_id
$a_xml
$a_mappingilImportMapping
Returns
string|void
Deprecated:

Definition at line 144 of file class.ilOrgUnitImporter.php.

References $new, $old, and ilObject2\_lookupType().

145  {
146  $container_mappings = $a_mapping->getMappingsOfEntity("Services/Container", "objs");
147  foreach ($container_mappings as $old => $new) {
149  if (ilObject2::_lookupType($new) == "orgu") {
150  $a_mapping->addMapping("Modules/OrgUnit", "orgu", $old, $new);
151  }
152  }
153  }
$old
static _lookupType($a_id, $a_reference=false)
+ Here is the call graph for this function:

Field Documentation

◆ $errors

ilOrgUnitImporter::$errors

Definition at line 17 of file class.ilOrgUnitImporter.php.

Referenced by getErrors().

◆ $stats

ilOrgUnitImporter::$stats

Definition at line 25 of file class.ilOrgUnitImporter.php.

Referenced by getStats().

◆ $warnings

ilOrgUnitImporter::$warnings

Definition at line 21 of file class.ilOrgUnitImporter.php.

Referenced by getWarnings().


The documentation for this class was generated from the following file: