41         return array(
"5.1.0", 
"4.1.0");
    44     protected function getXmlNamespace(
string $a_entity, 
string $a_schema_version): string
    46         return "https://www.ilias.de/xml/Modules/MediaPool/" . $a_entity;
    54         $this->master_lang_only = $a_val;
    66         if ($a_mep !== null) {
    67             $this->transl_into = 
true;
    68             $this->transl_into_mep = $a_mep;
    69             $this->transl_lang = $a_lang;
    71             $this->transl_into = 
false;
    93     protected function getTypes(
string $a_entity, 
string $a_version): array
    96         if ($a_entity === 
"mep") {
   102                         "Description" => 
"text",
   103                         "DefaultWidth" => 
"integer",
   104                         "DefaultHeight" => 
"integer");
   110                         "Description" => 
"text",
   111                         "DefaultWidth" => 
"integer",
   112                         "DefaultHeight" => 
"integer",
   113                         "ForTranslation" => 
"integer"   119         if ($a_entity === 
"mep_tree") {
   120             switch ($a_version) {
   124                         "MepId" => 
"integer",
   125                         "Child" => 
"integer",
   126                         "Parent" => 
"integer",
   127                         "Depth" => 
"integer",
   130                         "ForeignId" => 
"integer",
   138     public function readData(
string $a_entity, 
string $a_version, array $a_ids): void
   143         if ($a_entity === 
"mep") {
   144             switch ($a_version) {
   147                         " default_width, default_height" .
   148                         " FROM mep_data JOIN object_data ON (mep_data.id = object_data.obj_id) " .
   150                         $ilDB->in(
"id", $a_ids, 
false, 
"integer"));
   154                     $q = 
"SELECT id, title, description, " .
   155                         " default_width, default_height" .
   156                         " FROM mep_data JOIN object_data ON (mep_data.id = object_data.obj_id) " .
   158                         $ilDB->in(
"id", $a_ids, 
false, 
"integer");
   161                     $this->data = array();
   162                     while ($rec = 
$ilDB->fetchAssoc($set)) {
   164                             $rec[
"for_translation"] = 1;
   167                         foreach ($rec as $k => $v) {
   173                         $this->data[] = $rec;
   180         if ($a_entity === 
"mep_tree") {
   181             switch ($a_version) {
   184                         " ,parent,depth,type,title,foreign_id " .
   185                         " FROM mep_tree JOIN mep_item ON (child = obj_id) " .
   187                         $ilDB->in(
"mep_id", $a_ids, 
false, 
"integer") .
   194                         $type = 
" AND type <> " . 
$ilDB->quote(
"mob", 
"text");
   197                     $q = 
"SELECT mep_id, child " .
   198                         " ,parent,depth,type,title,foreign_id, import_id " .
   199                         " FROM mep_tree JOIN mep_item ON (child = obj_id) " .
   201                         $ilDB->in(
"mep_id", $a_ids, 
false, 
"integer") .
   206                     $this->data = array();
   207                     while ($rec = 
$ilDB->fetchAssoc($set)) {
   208                         $set2 = 
$ilDB->query(
"SELECT for_translation FROM mep_data WHERE id = " . 
$ilDB->quote($rec[
"mep_id"], 
true));
   209                         $rec2 = 
$ilDB->fetchAssoc($set2);
   210                         if (!$rec2[
"for_translation"]) {
   211                             $rec[
"import_id"] = 
"il_" . 
IL_INST_ID . 
"_" . $rec[
"type"] . 
"_" . $rec[
"child"];
   214                         foreach ($rec as $k => $v) {
   220                         $this->data[] = $rec;
   231         ?array $a_rec = null,
   237                     "mep_tree" => array(
"ids" => $a_rec[
"Id"] ?? null)
   248         string $a_schema_version
   259                 if ($new_id = $a_mapping->
getMapping(
'Services/Container', 
'objs', $a_rec[
'Id'])) {
   263                     $newObj->setType(
"mep");
   267                 $newObj->setTitle($a_rec[
"Title"]);
   268                 $newObj->setDescription($a_rec[
"Description"]);
   269                 $newObj->setDefaultWidth((
int) $a_rec[
"DefaultWidth"]);
   270                 $newObj->setDefaultHeight((
int) $a_rec[
"DefaultHeight"]);
   271                 $newObj->setForTranslation((
bool) ($a_rec[
"ForTranslation"] ?? 
false));
   274                 $this->current_obj = $newObj;
   275                 $a_mapping->
addMapping(
"Modules/MediaPool", 
"mep", $a_rec[
"Id"], $newObj->getId());
   276                 $a_mapping->
addMapping(
"Services/Object", 
"obj", $a_rec[
"Id"], $newObj->getId());
   281                     switch ($a_rec[
"Type"]) {
   283                             $parent = (
int) $a_mapping->
getMapping(
"Modules/MediaPool", 
"mep_tree", $a_rec[
"Parent"]);
   285                                 $this->current_obj->createFolder($a_rec[
"Title"], $parent);
   295                             $parent = (
int) $a_mapping->
getMapping(
"Modules/MediaPool", 
"mep_tree", $a_rec[
"Parent"]);
   296                             $mob_id = (
int) $a_mapping->
getMapping(
"Services/MediaObjects", 
"mob", $a_rec[
"ForeignId"]);
   298                             $item->setType(
"mob");
   299                             $item->setForeignId($mob_id);
   300                             $item->setImportId($a_rec[
"ImportId"]);
   301                             $item->setTitle($a_rec[
"Title"]);
   303                             if ($item->getId() > 0) {
   307                                 $this->current_obj->insertInTree($item->getId(), $parent);
   312                             $parent = (
int) $a_mapping->
getMapping(
"Modules/MediaPool", 
"mep_tree", $a_rec[
"Parent"]);
   315                             $item->setType(
"pg");
   316                             $item->setTitle($a_rec[
"Title"]);
   317                             $item->setImportId($a_rec[
"ImportId"]);
   319                             $a_mapping->
addMapping(
"Modules/MediaPool", 
"pg", $a_rec[
"Child"], $item->getId());
   323                                 "mep:" . $a_rec[
"Child"],
   324                                 "mep:" . $item->getId()
   326                             if ($item->getId() > 0) {
   330                                 $this->current_obj->insertInTree($item->getId(), $parent);
   334                 } elseif ($a_rec[
"Type"] === 
"pg") {
   335                     $imp_id = explode(
"_", $a_rec[
"ImportId"]);
   336                     if ($imp_id[0] === 
"il" &&
   342                         $pool = current($pool);
   344                             $a_mapping->
addMapping(
"Modules/MediaPool", 
"pg", $a_rec[
"Child"], $pg_id);
   348                                 "mep:" . $a_rec[
"Child"],
 
convertToLeadingUpper(string $a_str)
Make xyz_abc a XyzAbc string. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
 
getMapping(string $a_comp, string $a_entity, string $a_old_id)
 
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
 
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id 
 
stripTags(array $rec, array $omit_keys=[])