39 $this->database = $DIC->database();
48 if (!is_int(
$id) && !is_string(
$id)) {
49 throw new \InvalidArgumentException(
"Expected int or string as \$id, got: " . gettype(
$id));
52 if ($type ===
'reference_id') {
58 } elseif ($type ===
'external_id') {
71 if (!count($ref_ids)) {
89 $query =
"SELECT * FROM object_data " .
90 "INNER JOIN object_reference as ref on ref.obj_id = object_data.obj_id and ref.deleted is null " .
91 'WHERE object_data.type = "orgu" and import_id = ' . $this->database->quote($external_id,
"text") .
" " .
92 "ORDER BY create_date DESC";
94 $res = $this->database->query($query);
96 if ($this->database->numRows(
$res) > 1) {
105 return count($this->errors) != 0;
110 return count($this->warnings) != 0;
113 public function addWarning(
string $lang_var,
string $import_id, ?
string $action = null): void
115 $this->warnings[] = array(
'lang_var' => $lang_var,
'import_id' => $import_id,
'action' => $action);
118 public function addError(
string $lang_var,
string $import_id, ?
string $action = null): void
120 $this->errors[] = array(
'lang_var' => $lang_var,
'import_id' => $import_id,
'action' => $action);
145 $container_mappings = $a_mapping->
getMappingsOfEntity(
"components/ILIAS/Container",
"objs");
146 foreach ($container_mappings as $old => $new) {
148 $a_mapping->
addMapping(
'components/ILIAS/OrgUnit',
'orgu', $old, $new);
static _lookupObjIdByImportId(string $import_id)
Get (latest) object id for an import id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static _exists(int $id, bool $isReference=false, ?string $type="orgu")
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
hasMoreThanOneMatch(string $external_id)
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
buildRef($id, string $type)
getMappingsOfEntity(string $a_comp, string $a_entity)
static _isInTrash(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addError(string $lang_var, string $import_id, ?string $action=null)
addWarning(string $lang_var, string $import_id, ?string $action=null)