ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 @inheritdocs More...
 
 getLabel ()
 @inheritdocs More...
 
 isNotable ()
 @inheritdocs More...
 
 getPreconditions (Environment $environment)
 @inheritdocs More...
 
 achieve (Environment $environment)
 @inheritdocs More...
 
 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 (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 

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.

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 }

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

Member Function Documentation

◆ achieve()

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

@inheritdocs

Implements ILIAS\Setup\Objective.

Definition at line 73 of file ObjectiveWithPreconditions.php.

74 {
75 return $this->original->achieve($environment);
76 }
An environment holds resources to be used in the setup process.
Definition: Environment.php:12

◆ getHash()

ILIAS\Setup\ObjectiveWithPreconditions::getHash ( )

@inheritdocs

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 ( )

@inheritdocs

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)

@inheritdocs

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 ( )

@inheritdocs

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: