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

A wrapper around an objective that adds some preconditions. More...

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

Public Member Functions

 __construct (Objective $original, Objective ... $preconditions)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 

Protected Attributes

 $original
 
 $preconditions
 

Detailed Description

A wrapper around an objective that adds some preconditions.

ATTENTION: This will use the same hash then the original objective and will therefore be indistinguishable.

Definition at line 15 of file ObjectiveWithPreconditions.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\ObjectiveWithPreconditions::__construct ( Objective  $original,
Objective ...  $preconditions 
)

Definition at line 27 of file ObjectiveWithPreconditions.php.

References ILIAS\Setup\ObjectiveWithPreconditions\$original, and ILIAS\Setup\ObjectiveWithPreconditions\$preconditions.

28  {
29  if (count($preconditions) === 0) {
30  throw new \InvalidArgumentException(
31  "Expected at least one precondition."
32  );
33  }
34  $this->original = $original;
35  $this->preconditions = $preconditions;
36  }

Member Function Documentation

◆ achieve()

ILIAS\Setup\ObjectiveWithPreconditions::achieve ( Environment  $environment)

Implements ILIAS\Setup\Objective.

Definition at line 73 of file ObjectiveWithPreconditions.php.

73  : Environment
74  {
75  return $this->original->achieve($environment);
76  }

◆ getHash()

ILIAS\Setup\ObjectiveWithPreconditions::getHash ( )

Implements ILIAS\Setup\Objective.

Definition at line 41 of file ObjectiveWithPreconditions.php.

41  : string
42  {
43  return $this->original->getHash();
44  }

◆ getLabel()

ILIAS\Setup\ObjectiveWithPreconditions::getLabel ( )

Implements ILIAS\Setup\Objective.

Definition at line 49 of file ObjectiveWithPreconditions.php.

49  : string
50  {
51  return $this->original->getLabel();
52  }

◆ getPreconditions()

ILIAS\Setup\ObjectiveWithPreconditions::getPreconditions ( Environment  $environment)

Implements ILIAS\Setup\Objective.

Definition at line 65 of file ObjectiveWithPreconditions.php.

65  : array
66  {
67  return array_merge($this->preconditions, $this->original->getPreconditions($environment));
68  }

◆ isNotable()

ILIAS\Setup\ObjectiveWithPreconditions::isNotable ( )

Implements ILIAS\Setup\Objective.

Definition at line 57 of file ObjectiveWithPreconditions.php.

57  : bool
58  {
59  return $this->original->isNotable();
60  }

Field Documentation

◆ $original

ILIAS\Setup\ObjectiveWithPreconditions::$original
protected

◆ $preconditions

ILIAS\Setup\ObjectiveWithPreconditions::$preconditions
protected

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