ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AdminConfirmedObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\Setup;
24
29{
30 protected string $message;
31
32 public function __construct(string $message)
33 {
34 $this->message = $message;
35 }
36
40 public function getHash(): string
41 {
42 return hash(
43 "sha256",
44 get_class($this) . "::" . $this->message
45 );
46 }
47
51 public function getLabel(): string
52 {
53 return "Get a confirmation from admin.";
54 }
55
59 public function isNotable(): bool
60 {
61 return false;
62 }
63
67 public function getPreconditions(Setup\Environment $environment): array
68 {
69 return [];
70 }
71
75 public function achieve(Setup\Environment $environment): Setup\Environment
76 {
77 $admin_interaction = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
78
79 if (!$admin_interaction->confirmOrDeny($this->message)) {
81 $this->message
82 );
83 }
84
85 return $environment;
86 }
87
91 public function isApplicable(Setup\Environment $environment): bool
92 {
93 return true;
94 }
95}
Signals that a necessary confirmation from the admin is missing.
An admin needs to confirm something to achieve this objective.
getLabel()
Get a label that describes this objective.
isApplicable(Setup\Environment $environment)
@inheritDoc
getHash()
Get a hash for this objective.The hash of two objectives must be the same, if they are the same objec...
isNotable()
Get to know if this is an interesting objective for a human.
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...