3 declare(strict_types=1);
35 return "Migration of collection glossaries due to revision";
40 return Migration::INFINITE;
54 $this->db = $environment->
getResource(Environment::RESOURCE_DATABASE);
59 $set = $this->db->query(
60 "SELECT glossary.id AS glossary_id, glossary.virtual, glossary_term.id AS term_id, glossary_term.glo_id " .
61 " FROM glossary LEFT JOIN glossary_term ON glossary.id = glossary_term.glo_id " .
62 " WHERE glossary.virtual = 'level' OR glossary.virtual = 'subtree' " .
63 " ORDER BY glossary.id" 66 while ($rec = $this->db->fetchAssoc($set)) {
67 $glo_id = (
int) $rec[
"glossary_id"];
68 $term_id = (
int) $rec[
"term_id"];
69 if ($glo_id === $tmp_id) {
73 $this->db->manipulate(
74 "UPDATE glossary SET " .
75 " glossary.virtual = " . $this->db->quote(
"none",
"text") .
76 " WHERE glossary.id = " . $this->db->quote($glo_id,
"integer")
78 $this->
log(
"Convert glossary with id " . $glo_id .
" into Standard Glossary.");
80 $this->db->manipulate(
81 "UPDATE glossary SET " .
82 " glossary.virtual = " . $this->db->quote(
"coll",
"text") .
83 " WHERE glossary.id = " . $this->db->quote($glo_id,
"integer")
85 $this->
log(
"Convert glossary with id " . $glo_id .
" into Collection Glossary.");
92 protected function log(
string $str): void
99 $set = $this->db->query(
100 "SELECT glossary.virtual FROM glossary " .
101 " WHERE glossary.virtual = 'level' OR glossary.virtual = 'subtree'" 103 if ($rec = $this->db->fetchAssoc($set)) {
step(Environment $environment)
getRemainingAmountOfSteps()
getDefaultAmountOfStepsPerRun()
getPreconditions(Environment $environment)
prepare(Environment $environment)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.