ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilXmlImporter.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 abstract class ilXmlImporter
26 {
27  protected array $skip_entities = array();
28  protected ilImport $imp;
29  protected string $install_id;
30  protected string $install_url;
31  protected string $schema_version;
32  protected string $import_directory;
33 
34  public function __construct()
35  {
36  }
37 
38  public function setImport(ilImport $a_val): void
39  {
40  $this->imp = $a_val;
41  }
42 
43  public function getImport(): ilImport
44  {
45  return $this->imp;
46  }
47 
48  public function init(): void
49  {
50  }
51 
52  public function setInstallId(string $a_val): void
53  {
54  $this->install_id = $a_val;
55  }
56 
57  public function getInstallId(): string
58  {
59  return $this->install_id;
60  }
61 
62  public function setInstallUrl(string $a_val): void
63  {
64  $this->install_url = $a_val;
65  }
66 
67  public function getInstallUrl(): string
68  {
69  return $this->install_url;
70  }
71 
72  public function setSchemaVersion(string $a_val): void
73  {
74  $this->schema_version = $a_val;
75  }
76 
77  public function getSchemaVersion(): string
78  {
79  return $this->schema_version;
80  }
81 
82  public function setImportDirectory(string $a_val): void
83  {
84  $this->import_directory = $a_val;
85  }
86 
87  public function getImportDirectory(): string
88  {
90  }
91 
92  public function setSkipEntities(array $a_val): void
93  {
94  $this->skip_entities = $a_val;
95  }
96 
97  public function getSkipEntities(): array
98  {
99  return $this->skip_entities;
100  }
101 
102  // Is exporting and importing installation identical?
103  public function exportedFromSameInstallation(): bool
104  {
105  if ($this->getInstallId() > 0 && ($this->getInstallId() == IL_INST_ID)) {
106  return true;
107  }
108  return false;
109  }
110 
111  abstract public function importXmlRepresentation(
112  string $a_entity,
113  string $a_id,
114  string $a_xml,
115  ilImportMapping $a_mapping
116  ): void;
117 
118  public function finalProcessing(ilImportMapping $a_mapping): void
119  {
120  }
121 
122  // Called after all container objects have been imported.
123  public function afterContainerImportProcessing(ilImportMapping $mapping): void
124  {
125  }
126 }
const IL_INST_ID
Definition: constants.php:40
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
setInstallId(string $a_val)
finalProcessing(ilImportMapping $a_mapping)
setSkipEntities(array $a_val)
setInstallUrl(string $a_val)
Import class.
setImport(ilImport $a_val)
setSchemaVersion(string $a_val)
afterContainerImportProcessing(ilImportMapping $mapping)
setImportDirectory(string $a_val)
Xml importer class.