ILIAS  release_7 Revision v7.30-3-g800a261c036
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
5namespace ILIAS\Setup;
6
11{
15 protected $label;
16
20 protected $is_notable;
21
25 protected $objectives;
26
27 public function __construct(string $label, bool $is_notable, Objective ...$objectives)
28 {
29 $this->label = $label;
30 $this->is_notable = $is_notable;
31 $this->objectives = $objectives;
32 }
33
37 public function getObjectives() : array
38 {
39 return $this->objectives;
40 }
41
45 public function getHash() : string
46 {
47 return hash(
48 "sha256",
49 get_class($this) .
50 implode(
51 array_map(
52 function ($g) {
53 return $g->getHash();
54 },
56 )
57 )
58 );
59 }
60
64 public function getLabel() : string
65 {
66 return $this->label;
67 }
68
72 public function isNotable() : bool
73 {
74 return $this->is_notable;
75 }
76
80 public function getPreconditions(Environment $environment) : array
81 {
82 return $this->objectives;
83 }
84
88 public function achieve(Environment $environment) : Environment
89 {
90 return $environment;
91 }
92
96 public function isApplicable(Environment $environment) : bool
97 {
98 return false;
99 }
100}
An exception for terminatinating execution or to throw for unit testing.
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:12
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:15
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...