19declare(strict_types=1);
30 return 'Migration of booking object info files to the resource storage service.';
50 $r = $this->helper->getDatabase()->query(
51 'SELECT booking_object_id, pool_id, owner FROM booking_object JOIN object_data ON pool_id = obj_id WHERE obj_info_rid IS NULL LIMIT 1'
53 $d = $this->helper->getDatabase()->fetchObject($r);
54 $pool_id = (
int)
$d->pool_id;
55 $booking_object_id = (
int)
$d->booking_object_id;
56 $resource_owner_id = (
int)
$d->owner;
57 $base_path = $this->buildAbsolutPath($booking_object_id);
59 $rid = is_dir($base_path)
60 ? $this->helper->moveFirstFileOfPatternToStorage($base_path,
$pattern, $resource_owner_id)
62 $this->helper->getDatabase()->update(
76 $r = $this->helper->getDatabase()->query(
77 'SELECT count(booking_object_id) amount FROM booking_object JOIN object_data ON pool_id = obj_id WHERE obj_info_rid IS NULL'
80 return (
int) $this->helper->getDatabase()->fetchObject($r)->amount;
getRemainingAmountOfSteps()
Count up how many "things" need to be migrated.
ilResourceStorageMigrationHelper $helper
step(Environment $environment)
Run one step of the migration.
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.
buildAbsolutPath(int $booking_object_id)
getPreconditions(Environment $environment)
Objectives the migration depend on.
static createPathFromId(int $a_container_id, string $a_name)
Class ilResourceStorageMigrationHelper.
static getPreconditions()
An environment holds resources to be used in the setup process.
A migration is a potentially long lasting operation that can be broken into discrete steps.