ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Setup\Objective\Tentatively Class Reference

A wrapper around an objective that attempts to achieve the wrapped objective but won't stop the process on failure. More...

+ Inheritance diagram for ILIAS\Setup\Objective\Tentatively:
+ Collaboration diagram for ILIAS\Setup\Objective\Tentatively:

Public Member Functions

 __construct (Setup\Objective $other)
 
 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 (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 
- Public Member Functions inherited from ILIAS\Setup\Objective
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 

Protected Attributes

 $other
 

Detailed Description

A wrapper around an objective that attempts to achieve the wrapped objective but won't stop the process on failure.

Definition at line 13 of file Tentatively.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\Objective\Tentatively::__construct ( Setup\Objective  $other)

Definition at line 20 of file Tentatively.php.

References ILIAS\Setup\Objective\Tentatively\$other.

21  {
22  $this->other = $other;
23  }

Member Function Documentation

◆ achieve()

ILIAS\Setup\Objective\Tentatively::achieve ( Setup\Environment  $environment)

Definition at line 68 of file Tentatively.php.

References Vendor\Package\$e.

68  : Setup\Environment
69  {
70  try {
71  return $this->other->achieve($environment);
72  } catch (Setup\UnachievableException $e) {
73  }
74  return $environment;
75  }

◆ getHash()

ILIAS\Setup\Objective\Tentatively::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 25 of file Tentatively.php.

25  : string
26  {
27  if ($this->other instanceof Tentatively) {
28  return $this->other->getHash();
29  }
30  return "tentatively " . $this->other->getHash();
31  }

◆ getLabel()

ILIAS\Setup\Objective\Tentatively::getLabel ( )

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

Definition at line 33 of file Tentatively.php.

33  : string
34  {
35  if ($this->other instanceof Tentatively) {
36  return $this->other->getLabel();
37  }
38  return "Tentatively: " . $this->other->getLabel();
39  }

◆ getPreconditions()

ILIAS\Setup\Objective\Tentatively::getPreconditions ( Setup\Environment  $environment)

Definition at line 49 of file Tentatively.php.

49  : array
50  {
51  if ($this->other instanceof Tentatively) {
52  return $this->other->getPreconditions($environment);
53  }
54  return array_map(
55  function ($p) {
56  if ($p instanceof Tentatively) {
57  return $p;
58  }
59  return new Tentatively($p);
60  },
61  $this->other->getPreconditions($environment)
62  );
63  }

◆ isApplicable()

ILIAS\Setup\Objective\Tentatively::isApplicable ( Setup\Environment  $environment)

Definition at line 80 of file Tentatively.php.

80  : bool
81  {
82  return $this->other->isApplicable($environment);
83  }

◆ isNotable()

ILIAS\Setup\Objective\Tentatively::isNotable ( )

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

Implements ILIAS\Setup\Objective.

Definition at line 41 of file Tentatively.php.

41  : bool
42  {
43  return $this->other->isNotable();
44  }

Field Documentation

◆ $other

ILIAS\Setup\Objective\Tentatively::$other
protected

Definition at line 18 of file Tentatively.php.

Referenced by ILIAS\Setup\Objective\Tentatively\__construct().


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