19 declare(strict_types=1);
45 return "Delete All Data of Dynamic (CTM) Tests from Database.";
50 return self::DEFAULT_AMOUNT_OF_STEPS;
69 if (!$this->ilias_is_initialized) {
73 $this->ilias_is_initialized =
true;
75 $row_test_info = $this->db->fetchObject(
77 'SELECT obj_fi, test_id FROM tst_tests ' 84 $row_ref_id = $this->db->fetchObject(
86 'SELECT ref_id FROM object_reference ' 92 if ($row_ref_id !== null) {
101 (new \ilObjTest($row_test_info->obj_fi,
false))->
delete();
106 $test_obj = new \ilObjTest();
107 $test_obj->setTestId($row_test_info->test_id);
108 $test_obj->deleteTest();
115 $result = $this->db->query(
116 "SELECT count(*) as cnt FROM tst_tests" 117 .
" WHERE " . $this->db->equals(
'question_set_type',
'DYNAMIC_QUEST_SET',
'text',
true)
119 $row = $this->db->fetchAssoc($result);
121 return (
int) $row[
'cnt'] ?? 0;
A migration is a potentially long lasting operation that can be broken into discrete steps...
prepare(Environment $environment)
Prepare the migration by means of some environment.
getRemainingAmountOfSteps()
Count up how many "things" need to be migrated.
static initILIAS()
ilias initialisation
getPreconditions(Environment $environment)
Objectives the migration depend on.
getDefaultAmountOfStepsPerRun()
Tell the default amount of steps to be executed for one run of the migration.
bool $ilias_is_initialized
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
static removeObjectsFromSystem(array $a_ref_ids, bool $a_from_recovery_folder=false)
remove objects from trash bin and all entries therefore every object needs a specific deleteObject() ...
step(Environment $environment)
Run one step of the migration.
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.
static init(string $a_type)
Init context by type.
const RESOURCE_ADMIN_INTERACTION
const DEFAULT_AMOUNT_OF_STEPS