ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ObjectiveCollection.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
5 namespace ILIAS\Setup;
6 
7 use ILIAS\UI;
8 
13 {
17  protected $label;
18 
22  protected $is_notable;
23 
27  protected $objectives;
28 
29  public function __construct(string $label, bool $is_notable, Objective ...$objectives)
30  {
31  $this->label = $label;
32  $this->is_notable = $is_notable;
33  $this->objectives = $objectives;
34  }
35 
39  public function getObjectives() : array
40  {
41  return $this->objectives;
42  }
43 
47  public function getHash() : string
48  {
49  return hash(
50  "sha256",
51  get_class($this) .
52  implode(
53  array_map(
54  function ($g) {
55  return $g->getHash();
56  },
58  )
59  )
60  );
61  }
62 
66  public function getLabel() : string
67  {
68  return $this->label;
69  }
70 
74  public function isNotable() : bool
75  {
76  return $this->is_notable;
77  }
78 
82  public function getPreconditions(Environment $environment) : array
83  {
84  return $this->objectives;
85  }
86 
90  public function achieve(Environment $environment) : Environment
91  {
92  return $environment;
93  }
94 }
A objective collection is a objective that is achieved once all subobjectives are achieved...
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:14
achieve(Environment $environment)
getPreconditions(Environment $environment)
An environment holds resources to be used in the setup process.
Definition: Environment.php:11
__construct(string $label, bool $is_notable, Objective ... $objectives)