ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilDatabaseUpdateStep Class Reference

This encapsulate one database update step which is a method on some ilDatabaseUpdateSteps-object. More...

+ Inheritance diagram for ilDatabaseUpdateStep:
+ Collaboration diagram for ilDatabaseUpdateStep:

Public Member Functions

 __construct (ilDatabaseUpdateSteps $parent, int $num, Objective ... $preconditions)
 
 getHash ()
 @inheritdocs More...
 
- Public Member Functions inherited from ILIAS\Setup\CallableObjective
 __construct (callable $callable, string $label, bool $is_notable, Objective ... $preconditions)
 
 getHash ()
 @inheritdocs More...
 
 getLabel ()
 @inheritdocs More...
 
 isNotable ()
 @inheritdocs More...
 
 getPreconditions (Environment $environment)
 @inheritdocs More...
 
 achieve (Environment $environment)
 @inheritdocs More...
 
 getHash ()
 Get a hash for this objective. More...
 
 getLabel ()
 Get a label that describes this objective. More...
 
 isNotable ()
 Get to know if this is an interesting objective for a human. More...
 
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 

Protected Attributes

 $class_name
 
 $method_name
 
- Protected Attributes inherited from ILIAS\Setup\CallableObjective
 $callable
 
 $label
 
 $is_notable
 
 $preconditions
 

Detailed Description

This encapsulate one database update step which is a method on some ilDatabaseUpdateSteps-object.

This is a close collaborator of ilDatabaseUpdateSteps and should most probably not be used standalone.

Definition at line 16 of file class.ilDatabaseUpdateStep.php.

Constructor & Destructor Documentation

◆ __construct()

ilDatabaseUpdateStep::__construct ( ilDatabaseUpdateSteps  $parent,
int  $num,
Objective ...  $preconditions 
)

Definition at line 28 of file class.ilDatabaseUpdateStep.php.

32 {
33 $this->class_name = get_class($parent);
34 $this->method_name = \ilDatabaseUpdateSteps::STEP_METHOD_PREFIX . $num;
36 function (Environment $env) use ($parent, $num) {
37 $db = $env->getResource(Environment::RESOURCE_DATABASE);
38 $log = $env->getResource(\ilDatabaseUpdateStepExecutionLog::class);
39 if ($log) {
40 $log->started($this->class_name, $num);
41 }
42 call_user_func([$parent, $this->method_name], $db);
43 if ($log) {
44 $log->finished($this->class_name, $num);
45 }
46 },
47 "Database update step {$this->class_name}::{$this->method_name}",
48 false,
49 ...$preconditions
50 );
51 }
An environment holds resources to be used in the setup process.
Definition: Environment.php:12
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$log
Definition: result.php:15

References $log, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Setup\Environment\getResource(), and ilDatabaseUpdateSteps\STEP_METHOD_PREFIX.

+ Here is the call graph for this function:

Member Function Documentation

◆ getHash()

ilDatabaseUpdateStep::getHash ( )

@inheritdocs

Reimplemented from ILIAS\Setup\CallableObjective.

Definition at line 57 of file class.ilDatabaseUpdateStep.php.

57 : string
58 {
59 return hash(
60 "sha256",
61 $this->class_name . "::" . $this->method_name
62 );
63 }

Field Documentation

◆ $class_name

ilDatabaseUpdateStep::$class_name
protected

Definition at line 21 of file class.ilDatabaseUpdateStep.php.

◆ $method_name

ilDatabaseUpdateStep::$method_name
protected

Definition at line 26 of file class.ilDatabaseUpdateStep.php.


The documentation for this class was generated from the following file: