19 declare(strict_types=1);
31 private \ilDBInterface
$db;
35 return 'Remove Table for Content Translation Information & Move Information to Translations';
46 new \ilDatabaseInitializedObjective()
57 if (!$this->db->tableExists(
'obj_content_master_lng')) {
60 $query_result = $this->db->query(
61 'SELECT obj_id, master_lang, fallback_lang FROM obj_content_master_lng LIMIT ' . self::TESTS_PER_STEP
64 while (($row = $this->db->fetchObject($query_result)) !==
null) {
75 if ($row->fallback_lang !==
null && $row->fallback_lang !==
'') {
96 $this->db->manipulate(
97 "DELETE FROM obj_content_master_lng WHERE obj_id = {$row->obj_id}" 102 $this->db->dropTable(
'obj_content_master_lng');
108 if (!$this->db->tableExists(
'obj_content_master_lng')) {
112 $drop_table_steps = 0;
113 if ($this->db->tableExists(
'obj_content_master_lng')) {
114 $drop_table_steps = 1;
118 $this->db->fetchObject(
120 SELECT DISTINCT COUNT(obj_id) as cnt 121 FROM obj_content_master_lng 123 )->cnt / self::TESTS_PER_STEP
124 )) + $drop_table_steps;
A migration is a potentially long lasting operation that can be broken into discrete steps...
getPreconditions(Environment $environment)
Objectives the migration depend on.
step(Environment $environment)
Run one step of the migration.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getRemainingAmountOfSteps()
Count up how many "things" need to be migrated.
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...
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.
getDefaultAmountOfStepsPerRun()
Tell the default amount of steps to be executed for one run of the migration.
prepare(Environment $environment)
Prepare the migration by means of some environment.