ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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

Setup Objective $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 29 of file Tentatively.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 33 of file Tentatively.php.

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

34  {
35  $this->other = $other;
36  }

Member Function Documentation

◆ achieve()

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

Definition at line 81 of file Tentatively.php.

References Vendor\Package\$e.

81  : Setup\Environment
82  {
83  try {
84  return $this->other->achieve($environment);
85  } catch (Setup\UnachievableException $e) {
86  }
87  return $environment;
88  }

◆ 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 38 of file Tentatively.php.

38  : string
39  {
40  if ($this->other instanceof Tentatively) {
41  return $this->other->getHash();
42  }
43  return "tentatively " . $this->other->getHash();
44  }

◆ getLabel()

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

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

Definition at line 46 of file Tentatively.php.

46  : string
47  {
48  if ($this->other instanceof Tentatively) {
49  return $this->other->getLabel();
50  }
51  return "Tentatively: " . $this->other->getLabel();
52  }

◆ getPreconditions()

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

Definition at line 62 of file Tentatively.php.

62  : array
63  {
64  if ($this->other instanceof Tentatively) {
65  return $this->other->getPreconditions($environment);
66  }
67  return array_map(
68  function ($p): \ILIAS\Setup\Objective\Tentatively {
69  if ($p instanceof Tentatively) {
70  return $p;
71  }
72  return new Tentatively($p);
73  },
74  $this->other->getPreconditions($environment)
75  );
76  }
Interface Observer Contains several chained tasks and infos about them.

◆ isApplicable()

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

Definition at line 93 of file Tentatively.php.

93  : bool
94  {
95  return $this->other->isApplicable($environment);
96  }

◆ 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 54 of file Tentatively.php.

54  : bool
55  {
56  return $this->other->isNotable();
57  }

Field Documentation

◆ $other

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

Definition at line 31 of file Tentatively.php.

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


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