ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
CallableObjective.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Setup\Objective
;
22
23
use
ILIAS\Setup
;
24
31
class
CallableObjective
implements
Setup\Objective
32
{
36
protected
$callable
;
37
38
protected
string
$label
;
39
40
protected
bool
$is_notable
;
41
45
protected
array
$preconditions
;
46
47
public
function
__construct
(callable
$callable
,
string
$label
,
bool
$is_notable
,
Setup
\
Objective
...
$preconditions
)
48
{
49
$this->callable =
$callable
;
50
$this->label =
$label
;
51
$this->is_notable =
$is_notable
;
52
$this->preconditions =
$preconditions
;
53
}
54
55
public
function
getHash
(): string
56
{
57
return
hash(
58
"sha256"
,
59
spl_object_hash($this)
60
);
61
}
62
63
public
function
getLabel
(): string
64
{
65
return
$this->label
;
66
}
67
68
public
function
isNotable
(): bool
69
{
70
return
$this->is_notable
;
71
}
72
73
public
function
getPreconditions
(
Setup
\
Environment
$environment): array
74
{
75
return
$this->preconditions
;
76
}
77
78
public
function
achieve
(
Setup
\
Environment
$environment):
Setup
\
Environment
79
{
80
$res
= call_user_func($this->callable, $environment);
81
if
(
$res
instanceof
Setup
\
Environment
) {
82
return
$res
;
83
}
84
return
$environment;
85
}
86
87
public
function
isApplicable
(
Setup
\
Environment
$environment): bool
88
{
89
return
true
;
90
}
91
}
ILIAS\Setup\Objective\CallableObjective
A callable objective wraps a callable into an objective.
Definition:
CallableObjective.php:32
ILIAS\Setup\Objective\CallableObjective\$label
string $label
Definition:
CallableObjective.php:38
ILIAS\Setup\Objective\CallableObjective\$callable
$callable
Definition:
CallableObjective.php:36
ILIAS\Setup\Objective\CallableObjective\getHash
getHash()
Get a hash for this objective.
Definition:
CallableObjective.php:55
ILIAS\Setup\Objective\CallableObjective\getLabel
getLabel()
Get a label that describes this objective.
Definition:
CallableObjective.php:63
ILIAS\Setup\Objective\CallableObjective\isNotable
isNotable()
Get to know if this is an interesting objective for a human.
Definition:
CallableObjective.php:68
ILIAS\Setup\Objective\CallableObjective\getPreconditions
getPreconditions(Setup\Environment $environment)
Definition:
CallableObjective.php:73
ILIAS\Setup\Objective\CallableObjective\$preconditions
array $preconditions
Definition:
CallableObjective.php:45
ILIAS\Setup\Objective\CallableObjective\achieve
achieve(Setup\Environment $environment)
Definition:
CallableObjective.php:78
ILIAS\Setup\Objective\CallableObjective\$is_notable
bool $is_notable
Definition:
CallableObjective.php:40
ILIAS\Setup\Objective\CallableObjective\isApplicable
isApplicable(Setup\Environment $environment)
Definition:
CallableObjective.php:87
ILIAS\Setup\Objective\CallableObjective\__construct
__construct(callable $callable, string $label, bool $is_notable, Setup\Objective ... $preconditions)
Definition:
CallableObjective.php:47
ILIAS\Setup
Definition:
Setup.php:26
ILIAS\Setup\Environment
An environment holds resources to be used in the setup process.
Definition:
Environment.php:28
ILIAS\Setup\Objective
An objective is a desired state of the system that is supposed to be created by the setup.
Definition:
Objective.php:31
ILIAS\Setup\Objective
Definition:
AdminConfirmedObjective.php:21
ILIAS\Setup
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
ilMysqlMyIsamToInnoDbMigration.php:19
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:30
components
ILIAS
Setup
src
Objective
CallableObjective.php
Generated on Wed Nov 11 2026 23:09:02 for ILIAS by
1.9.4 (using
Doxyfile
)