ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
- Public Member Functions inherited from ILIAS\Setup\CallableObjective
 __construct (callable $callable, string $label, bool $is_notable, Objective ... $preconditions)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 

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.

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

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  }
$log
Definition: result.php:15
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
Definition: Environment.php:11
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getHash()

ilDatabaseUpdateStep::getHash ( )

Implements ILIAS\Setup\Objective.

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: