ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
Agent.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\User\Setup;
22
26use ILIAS\Setup;
28use ILIAS\Setup\Agent\HasNoNamedObjective;
32
33class Agent implements SetupAgent
34{
35 use HasNoNamedObjective;
36
37 public function __construct(
38 private readonly array $user_settings_contributions,
39 private readonly array $user_custom_profile_fields,
40 private readonly array $user_field_attributes_change_listeners
41 ) {
42 }
43
44 public function hasConfig(): bool
45 {
46 return false;
47 }
48
50 {
51 throw new LogicException(self::class . ' has no Config.');
52 }
53
54 public function getInstallObjective(?Setup\Config $config = null): Setup\Objective
55 {
56 return new ObjectiveCollection(
57 'Updates for User',
58 false,
59 new CollectSettingsObjective($this->user_settings_contributions),
60 new CollectTypesObjective($this->user_custom_profile_fields),
61 new CollectListenersObjective($this->user_field_attributes_change_listeners)
62 );
63 }
64
65 public function getBuildObjective(): Objective
66 {
67 return new ObjectiveCollection(
68 'Updates for User',
69 false,
70 new CollectSettingsObjective($this->user_settings_contributions),
71 new CollectTypesObjective($this->user_custom_profile_fields),
72 new CollectListenersObjective($this->user_field_attributes_change_listeners)
73 );
74 }
75
76 public function getUpdateObjective(?Setup\Config $config = null): Setup\Objective
77 {
78 return new ObjectiveCollection(
79 'Updates for User',
80 false,
82 new DBUpdateSteps11()
83 ),
85 new CollectSettingsObjective($this->user_settings_contributions),
86 new CollectTypesObjective($this->user_custom_profile_fields),
87 new CollectListenersObjective($this->user_field_attributes_change_listeners)
88 );
89 }
90
91 public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
92 {
93 return new \ilDatabaseUpdateStepsMetricsCollectedObjective(
94 $storage,
95 new DBUpdateSteps11()
96 );
97 }
98
99 public function getMigrations(): array
100 {
101 return [
104 ];
105 }
106}
A objective collection is a objective that is achieved once all subobjectives are achieved.
getUpdateObjective(?Setup\Config $config=null)
Definition: Agent.php:76
__construct(private readonly array $user_settings_contributions, private readonly array $user_custom_profile_fields, private readonly array $user_field_attributes_change_listeners)
Definition: Agent.php:37
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.
Definition: Agent.php:65
getInstallObjective(?Setup\Config $config=null)
Definition: Agent.php:54
getStatusObjective(Setup\Metrics\Storage $storage)
Definition: Agent.php:91
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.
Definition: Agent.php:49
hasConfig()
Does this agent require a configuration?
Definition: Agent.php:44
getMigrations()
Get a named map of migrations available for this Agent.
Definition: Agent.php:99
This class attempt to achieve a set of database update steps.
A transformation is a function from one datatype to another.
A agent is some component that performs part of the setup process.
Definition: Agent.php:30
A configuration for the setup.
Definition: Config.php:27
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
Storage is simple key/value store without further schema definition.
Definition: Storage.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...