ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Setup\AdminConfirmedObjective Class Reference

An admin needs to confirm something to achieve this objective. More...

+ Inheritance diagram for ILIAS\Setup\AdminConfirmedObjective:
+ Collaboration diagram for ILIAS\Setup\AdminConfirmedObjective:

Public Member Functions

 __construct (string $message)
 
 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. 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.
Exceptions
UnachievableExceptionif the objective is not achievable
Returns
Objective[]
More...
 
 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
More...
 

Protected Attributes

 $message
 

Detailed Description

An admin needs to confirm something to achieve this objective.

Definition at line 12 of file AdminConfirmedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\AdminConfirmedObjective::__construct ( string  $message)

Member Function Documentation

◆ achieve()

ILIAS\Setup\AdminConfirmedObjective::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 62 of file AdminConfirmedObjective.php.

References ILIAS\Setup\Environment\getResource(), ILIAS\Setup\Environment\RESOURCE_ACHIEVEMENT_TRACKER, and ILIAS\Setup\Environment\RESOURCE_ADMIN_INTERACTION.

62  : Environment
63  {
64  $admin_interaction = $environment->getResource(Environment::RESOURCE_ADMIN_INTERACTION);
65  $achievement_tracker = $environment->getResource(Environment::RESOURCE_ACHIEVEMENT_TRACKER);
66 
67  if ($achievement_tracker->isAchieved($this)) {
68  return $environment;
69  }
70 
71  if (!$admin_interaction->confirmOrDeny($this->message)) {
72  throw new NoConfirmationException(
73  $this->message
74  );
75  }
76 
77  $achievement_tracker->trackAchievementOf($this);
78 
79  return $environment;
80  }
+ Here is the call graph for this function:

◆ getHash()

ILIAS\Setup\AdminConfirmedObjective::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 27 of file AdminConfirmedObjective.php.

27  : string
28  {
29  return hash(
30  "sha256",
31  get_class($this) . "::" . $this->message
32  );
33  }

◆ getLabel()

ILIAS\Setup\AdminConfirmedObjective::getLabel ( )

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

Definition at line 38 of file AdminConfirmedObjective.php.

38  : string
39  {
40  return "Get a confirmation from admin.";
41  }

◆ getPreconditions()

ILIAS\Setup\AdminConfirmedObjective::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 54 of file AdminConfirmedObjective.php.

54  : array
55  {
56  return [];
57  }

◆ isNotable()

ILIAS\Setup\AdminConfirmedObjective::isNotable ( )

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

Implements ILIAS\Setup\Objective.

Definition at line 46 of file AdminConfirmedObjective.php.

46  : bool
47  {
48  return false;
49  }

Field Documentation

◆ $message

ILIAS\Setup\AdminConfirmedObjective::$message
protected

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