ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CollectListenersObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28
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}
An array as an artifact.
This is an objective to build some artifact.
getArtifactName()
Get the filename where the builder wants to put its 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
isInterestedInField()
MUST return the fully qualified class name of the profile field the component is interested in.