ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 96 of file class.ilOrgUnitImporter.php.

References array.

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

96  {
97  $this->errors[] = array( 'lang_var' => $lang_var, 'import_id' => $import_id, 'action' => $action );
98  }
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 86 of file class.ilOrgUnitImporter.php.

References array.

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

86  {
87  $this->warnings[] = array( 'lang_var' => $lang_var, 'import_id' => $import_id, 'action' => $action );
88  }
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 $ref_id, ilObjOrgUnit\_exists(), ilObject\_getAllReferences(), ilObject\_hasUntrashedReference(), ilObject\_isInTrash(), and ilObject\_lookupObjIdByImportId().

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

34  {
35  if ($type == 'reference_id') {
36  if (!ilObjOrgUnit::_exists($id, true)) {
37  return false;
38  }
39 
40  return $id;
41  } elseif ($type == 'external_id') {
42  $obj_id = ilObject::_lookupObjIdByImportId($id);
43 
44  if (!ilObject::_hasUntrashedReference($obj_id)) {
45  return false;
46  }
47 
48  $ref_ids = ilObject::_getAllReferences($obj_id);
49 
50  if (!count($ref_ids)) {
51  return false;
52  }
53 
54  foreach($ref_ids as $ref_id) {
55  if(!ilObject::_isInTrash($ref_id))
56  return $ref_id;
57  }
58  return false;
59  } else {
60  return false;
61  }
62  }
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
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
$ref_id
Definition: sahs_server.php:39
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 104 of file class.ilOrgUnitImporter.php.

References $errors.

104  {
105  return $this->errors;
106  }

◆ getStats()

ilOrgUnitImporter::getStats ( )
Returns
array

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

References $stats.

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

◆ getWarnings()

ilOrgUnitImporter::getWarnings ( )
Returns
array

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

References $warnings.

112  {
113  return $this->warnings;
114  }

◆ hasErrors()

ilOrgUnitImporter::hasErrors ( )
Returns
bool

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

68  {
69  return count($this->errors) != 0;
70  }

◆ hasWarnings()

ilOrgUnitImporter::hasWarnings ( )
Returns
bool

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

76  {
77  return count($this->warnings) != 0;
78  }

◆ 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 135 of file class.ilOrgUnitImporter.php.

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

135  {
136  $container_mappings = $a_mapping->getMappingsOfEntity("Services/Container", "objs");
137  foreach($container_mappings as $old => $new) {
139  $a_mapping->addMapping("Modules/OrgUnit", "orgu", $old, $new);
140  }
141  }
142  }
$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: