ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDBStepReaderExistsObjective Class Reference
+ Inheritance diagram for ilDBStepReaderExistsObjective:
+ Collaboration diagram for ilDBStepReaderExistsObjective:

Public Member Functions

 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...
 
 isApplicable (Environment $environment)
 

Detailed Description

Definition at line 22 of file class.ilDBStepReaderExistsObjective.php.

Member Function Documentation

◆ achieve()

ilDBStepReaderExistsObjective::achieve ( Environment  $environment)

Objectives can be achieved.

They might add resources to the environment when they have been achieved.

This method needs to be idempotent for a given environment. That means: if this is executed a second time, nothing new should happen. Or the other way round: if the environment already looks like desired, the objective should not take any further actions when this is called.

Exceptions

Implements ILIAS\Setup\Objective.

Definition at line 46 of file class.ilDBStepReaderExistsObjective.php.

References ILIAS\Setup\Environment\withResource().

46  : Environment
47  {
48  return $environment
49  ->withResource(
50  ilDBStepReader::class,
51  new ilDBStepReader()
52  );
53  }
withResource(string $id, $resource)
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
+ Here is the call graph for this function:

◆ getHash()

ilDBStepReaderExistsObjective::getHash ( )

Get a hash for this objective.

The hash of two objectives must be the same, if they are the same objective, with the same config on the same environment, i.e. if the one is achieved the other is achieved as well because they are the same.

Implements ILIAS\Setup\Objective.

Definition at line 24 of file class.ilDBStepReaderExistsObjective.php.

24  : string
25  {
26  return hash("sha256", self::class);
27  }

◆ getLabel()

ilDBStepReaderExistsObjective::getLabel ( )

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

Definition at line 29 of file class.ilDBStepReaderExistsObjective.php.

29  : string
30  {
31  return "The step reader for database update steps exists.";
32  }

◆ getPreconditions()

ilDBStepReaderExistsObjective::getPreconditions ( Environment  $environment)

Objectives might depend on other objectives.

Exceptions
UnachievableExceptionif the objective is not achievable
Returns
Objective[]

Implements ILIAS\Setup\Objective.

Definition at line 39 of file class.ilDBStepReaderExistsObjective.php.

39  : array
40  {
41  return [
43  ];
44  }

◆ isApplicable()

ilDBStepReaderExistsObjective::isApplicable ( Environment  $environment)

Implements ILIAS\Setup\Objective.

Definition at line 58 of file class.ilDBStepReaderExistsObjective.php.

References ILIAS\Setup\Environment\getResource().

58  : bool
59  {
60  $execution_db = $environment->getResource(ilDBStepReader::class);
61  return is_null($execution_db);
62  }
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
+ Here is the call graph for this function:

◆ isNotable()

ilDBStepReaderExistsObjective::isNotable ( )

Get to know if this is an interesting objective for a human.

Implements ILIAS\Setup\Objective.

Definition at line 34 of file class.ilDBStepReaderExistsObjective.php.

34  : bool
35  {
36  return true;
37  }

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