ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ObjectiveCollection.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\Setup;
22 
27 {
28  protected string $label;
29  protected bool $is_notable;
30 
34  protected array $objectives;
35 
36  public function __construct(string $label, bool $is_notable, Objective ...$objectives)
37  {
38  $this->label = $label;
39  $this->is_notable = $is_notable;
40  $this->objectives = $objectives;
41  }
42 
46  public function getObjectives(): array
47  {
48  return $this->objectives;
49  }
50 
54  public function getHash(): string
55  {
56  return hash(
57  "sha256",
58  get_class($this) .
59  implode(
60  array_map(
61  fn ($g): string => $g->getHash(),
63  )
64  )
65  );
66  }
67 
71  public function getLabel(): string
72  {
73  return $this->label;
74  }
75 
79  public function isNotable(): bool
80  {
81  return $this->is_notable;
82  }
83 
87  public function getPreconditions(Environment $environment): array
88  {
89  return $this->objectives;
90  }
91 
95  public function achieve(Environment $environment): Environment
96  {
97  return $environment;
98  }
99 
103  public function isApplicable(Environment $environment): bool
104  {
105  return false;
106  }
107 }
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:30
achieve(Environment $environment)
isApplicable(Environment $environment)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPreconditions(Environment $environment)
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
__construct(string $label, bool $is_notable, Objective ... $objectives)