ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
CollectListenersObjective.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\User\Profile\ChangeListeners
;
22
23
use
ILIAS\User\Profile\Fields\FieldDefinition
;
24
use
ILIAS\User\Profile\ChangeListeners\UserFieldAttributesChangeListener
;
25
use
ILIAS\Setup\Artifact
;
26
use
ILIAS\Setup\Artifact\ArrayArtifact
;
27
use
ILIAS\Setup\Artifact\BuildArtifactObjective
;
28
29
class
CollectListenersObjective
extends
BuildArtifactObjective
30
{
34
public
function
__construct
(
35
private
readonly array $contributions
36
) {
37
}
38
39
public
function
getArtifactName
(): string
40
{
41
return
'profile_attribute_change_listeners'
;
42
}
43
44
public
function
build
():
Artifact
45
{
46
return
new
ArrayArtifact
(
47
array_map(
48
static
function
(
UserFieldAttributesChangeListener
$v):
string
{
49
$field_class = $v->
isInterestedInField
();
50
if
(!(
new
$field_class() instanceof
FieldDefinition
)) {
51
throw
new \Exception(
'The Field '
. $v::class
52
.
' is interested in, does not exist.'
);
53
}
54
return
$v::class;
55
},
56
$this->contributions
57
)
58
);
59
}
60
}
ILIAS\Setup\Artifact\ArrayArtifact
An array as an artifact.
Definition:
ArrayArtifact.php:29
ILIAS\Setup\Artifact\BuildArtifactObjective
This is an objective to build some artifact.
Definition:
BuildArtifactObjective.php:34
ILIAS\User\Profile\ChangeListeners\CollectListenersObjective
Definition:
CollectListenersObjective.php:30
ILIAS\User\Profile\ChangeListeners\CollectListenersObjective\__construct
__construct(private readonly array $contributions)
Definition:
CollectListenersObjective.php:34
ILIAS\User\Profile\ChangeListeners\CollectListenersObjective\getArtifactName
getArtifactName()
Get the filename where the builder wants to put its artifact.
Definition:
CollectListenersObjective.php:39
ILIAS\User\Profile\ChangeListeners\CollectListenersObjective\build
build()
Build the artifact based.
Definition:
CollectListenersObjective.php:44
ILIAS\Setup\Artifact
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
Definition:
Artifact.php:28
ILIAS\User\Profile\ChangeListeners\UserFieldAttributesChangeListener
Definition:
UserFieldAttributesChangeListener.php:27
ILIAS\User\Profile\ChangeListeners\UserFieldAttributesChangeListener\isInterestedInField
isInterestedInField()
MUST return the fully qualified class name of the profile field the component is interested in.
ILIAS\User\Profile\Fields\FieldDefinition
Definition:
FieldDefinition.php:26
ILIAS\Setup\Artifact
Definition:
ArrayArtifact.php:21
ILIAS\User\Profile\ChangeListeners
Definition:
ChangedUserFieldAttribute.php:21
components
ILIAS
User
src
Profile
ChangeListeners
CollectListenersObjective.php
Generated on Sat Oct 18 2025 23:04:58 for ILIAS by
1.9.4 (using
Doxyfile
)