ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Questions\Setup\Agent Class Reference
+ Inheritance diagram for ILIAS\Questions\Setup\Agent:
+ Collaboration diagram for ILIAS\Questions\Setup\Agent:

Public Member Functions

 __construct (private readonly PersistenceFactory $persistence_factory, private readonly TableNameBuilder $question_table_names_builder, private readonly array $answer_form_migrations, private readonly array $capability_migrations)
 
 hasConfig ()
 Does this agent require a configuration? More...
 
 getArrayToConfigTransformation ()
 Agents must be able to tell how to create a configuration from a nested array. More...
 
 getUpdateObjective (?Config $config=null)
 Get the goal the agent wants to achieve on update. More...
 
 getStatusObjective (Storage $storage)
 
 getMigrations ()
 Get a named map of migrations available for this Agent. More...
 
 getBuildObjective ()
 Get the goal the agent wants to achieve to build artifacts. More...
 
 getInstallObjective (?Config $config=null)
 Get the goals the agent wants to achieve on setup. More...
 
 getUpdateObjective (?Config $config=null)
 Get the goal the agent wants to achieve on update. More...
 
- Public Member Functions inherited from ILIAS\Setup\Agent\NullAgent
 __construct (Refinery $refinery)
 
 hasConfig ()
 @inheritdocs More...
 
 getArrayToConfigTransformation ()
 @inheritdocs More...
 
 getInstallObjective (?Config $config=null)
 @inheritdocs More...
 
 getUpdateObjective (?Config $config=null)
 @inheritdocs More...
 
 getBuildObjective ()
 @inheritdocs More...
 
 getStatusObjective (Metrics\Storage $storage)
 @inheritdocs More...
 
 getMigrations ()
 @inheritDoc More...
 
 getNamedObjectives (?Config $config=null)
 Gets all named objectives The keys of the returned array are the commands. More...
 
- Public Member Functions inherited from ILIAS\Setup\Agent
 hasConfig ()
 Does this agent require a configuration? More...
 
 getArrayToConfigTransformation ()
 Agents must be able to tell how to create a configuration from a nested array. More...
 
 getInstallObjective (?Config $config=null)
 Get the goals the agent wants to achieve on setup. More...
 
 getUpdateObjective (?Config $config=null)
 Get the goal the agent wants to achieve on update. More...
 
 getBuildObjective ()
 Get the goal the agent wants to achieve to build artifacts. More...
 
 getStatusObjective (Metrics\Storage $storage)
 Get the objective to be achieved when status is requested. More...
 
 getMigrations ()
 Get a named map of migrations available for this Agent. More...
 
 getNamedObjectives (?Config $config=null)
 Gets all named objectives The keys of the returned array are the commands. More...
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Setup\Agent\NullAgent
Refinery $refinery
 

Detailed Description

Definition at line 38 of file Agent.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Questions\Setup\Agent::__construct ( private readonly PersistenceFactory  $persistence_factory,
private readonly TableNameBuilder  $question_table_names_builder,
private readonly array  $answer_form_migrations,
private readonly array  $capability_migrations 
)
Parameters
array<

ILIAS\Questions\AnswerForm\Migration\Migration> $answer_form_migrations

Parameters
array<

ILIAS\Questions\AnswerForm\Capabilities\Migration> $capability_migrations

Definition at line 46 of file Agent.php.

51 {
52 }

Member Function Documentation

◆ getArrayToConfigTransformation()

ILIAS\Questions\Setup\Agent::getArrayToConfigTransformation ( )

Agents must be able to tell how to create a configuration from a nested array.

Exceptions
LogicExceptionif Agent has no Config

Implements ILIAS\Setup\Agent.

Definition at line 59 of file Agent.php.

59 : Transformation
60 {
61 throw new \LogicException(self::class . ' has no Config.');
62 }

◆ getBuildObjective()

ILIAS\Questions\Setup\Agent::getBuildObjective ( )

Get the goal the agent wants to achieve to build artifacts.

Exceptions
InvalidArgumentExceptionif Config does not match the Agent.

Implements ILIAS\Setup\Agent.

Definition at line 157 of file Agent.php.

157 : Objective
158 {
159 return new NullObjective();
160 }

◆ getInstallObjective()

ILIAS\Questions\Setup\Agent::getInstallObjective ( ?Config  $config = null)

Get the goals the agent wants to achieve on setup.

The provided configuration is to be used to set according configuration values in the installation.

Exceptions
InvalidArgumentExceptionif Config does not match the Agent..

Implements ILIAS\Setup\Agent.

Definition at line 163 of file Agent.php.

165 : Objective {
166 return new NullObjective();
167 }

◆ getMigrations()

ILIAS\Questions\Setup\Agent::getMigrations ( )

Get a named map of migrations available for this Agent.

Should also return Migrations that have run completely.

Returns
array<string,Migration>|Migration[]

Implements ILIAS\Setup\Agent.

Definition at line 138 of file Agent.php.

138 : array
139 {
140 return [
141 new QuestionsMigration(
142 $this->persistence_factory,
143 $this->question_table_names_builder,
144 new QuestionTableDefinitions(
145 $this->persistence_factory
146 ),
147 new AnswerFormGenericTableDefinitions(
148 $this->persistence_factory
149 ),
150 $this->answer_form_migrations,
151 $this->capability_migrations
152 )
153 ];
154 }

◆ getStatusObjective()

ILIAS\Questions\Setup\Agent::getStatusObjective ( Storage  $storage)

Definition at line 104 of file Agent.php.

106 : Objective {
107 return new ObjectiveCollection(
108 'ILIAS\Questions',
109 true,
111 $storage,
112 new OverarchingQuestionTables(
113 $this->question_table_names_builder
114 )
115 ),
117 $storage,
118 new ClozeQuestionTables(
119 new SetupTableNameBuilder(
120 new TableSubNameSpace(
121 'ILIAS',
122 'cloze'
123 )
124 ),
125 new ClozeTableDefinitions(
126 $this->persistence_factory,
127 new TableSubNameSpace(
128 'ILIAS',
129 'cloze'
130 )
131 )
132 )
133 )
134 );
135 }

◆ getUpdateObjective()

ILIAS\Questions\Setup\Agent::getUpdateObjective ( ?Config  $config = null)

Get the goal the agent wants to achieve on update.

The provided configuration is to be used to change according configuration values in the installation. If this is not possible for some reason, an according UnachievableException needs to be thrown in the according objective.

The configuration is not to be used to initialize the required environment for the objectives. This must be done via ClientIdReadObjective and depending objectives like ilIniFilesLoadedObjective.

If no configuration is provided the configuration of the component should stay as is.

Exceptions
InvalidArgumentExceptionif Config does not match the Agent..

Reimplemented from ILIAS\StaticURL\SetupAgent.

Definition at line 65 of file Agent.php.

67 : Objective {
68 return new ObjectiveCollection(
69 'Database is updated for ILIAS\Questions',
70 false,
72 new OverarchingQuestionTables(
73 $this->question_table_names_builder
74 )
75 ),
77 new ClozeQuestionTables(
78 new SetupTableNameBuilder(
79 new TableSubNameSpace(
80 'ILIAS',
81 'cloze'
82 )
83 ),
84 new ClozeTableDefinitions(
85 $this->persistence_factory,
86 new TableSubNameSpace(
87 'ILIAS',
88 'cloze'
89 )
90 )
91 )
92 ),
94 new TempTables()
95 ),
97 'qsts',
98 'Questions'
99 )
100 );
101 }
This class attempt to achieve a set of database update steps.

◆ hasConfig()

ILIAS\Questions\Setup\Agent::hasConfig ( )

Does this agent require a configuration?

Implements ILIAS\Setup\Agent.

Definition at line 54 of file Agent.php.

54 : bool
55 {
56 return false;
57 }

The documentation for this class was generated from the following file: