ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ObjectiveCollection.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace 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(),
62 $this->objectives
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.
getPreconditions(Environment $environment)
@inheritdocs
achieve(Environment $environment)
@inheritdocs
isApplicable(Environment $environment)
@inheritdocs
__construct(string $label, bool $is_notable, Objective ... $objectives)
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...