ILIAS  release_8 Revision v8.23
class.ilEmployeeTalkSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\EmployeeTalk\Setup;
22 
24 use ILIAS\Setup;
31 
35 final class ilEmployeeTalkSetupAgent implements Setup\Agent
36 {
37  public function hasConfig(): bool
38  {
39  return false;
40  }
41 
43  {
44  throw new \LogicException(
45  self::class . " has no config."
46  );
47  }
48 
49  public function getInstallObjective(Config $config = null): Objective
50  {
51  return new \ilTreeAdminNodeAddedObjective('tala', '__TalkTemplateAdministration');
52  }
53 
55  {
56  return new Objective\NullObjective();
57  }
58 
59  public function getStatusObjective(Metrics\Storage $storage): Objective
60  {
61  return new Objective\NullObjective();
62  }
63 
64  public function getMigrations(): array
65  {
66  return [];
67  }
68 
69  public function getNamedObjectives(?Config $config = null): array
70  {
71  return [];
72  }
73 
74 
75  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
76  {
77  return new Setup\ObjectiveCollection(
78  'Employee Talks',
79  true,
80  new \ilTreeAdminNodeAddedObjective('tala', '__TalkTemplateAdministration'),
82  ...$this->getOrgUnitObjectives()
83  );
84  }
85 
86  protected function getOrgUnitObjectives(): array
87  {
88  $objectives = [];
89 
90  $objectives[] = new \ilOrgUnitOperationContextRegisteredObjective(
93  );
94 
95  $objectives[] = new \ilOrgUnitOperationRegisteredObjective(
97  'Read Employee Talk',
99  );
100 
101  $objectives[] = new \ilOrgUnitOperationRegisteredObjective(
103  'Create Employee Talk',
105  );
106 
107  $objectives[] = new \ilOrgUnitOperationRegisteredObjective(
109  'Edit Employee Talk (not only own)',
111  );
112 
113  return $objectives;
114  }
115 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A objective collection is a objective that is achieved once all subobjectives are achieved...
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
getBuildArtifactObjective()
Get the goal the agent wants to achieve to build artifacts.
$objectives
getInstallObjective(Config $config=null)
Get the goals the agent wants to achieve on setup.
getMigrations()
Get a named map of migrations available for this Agent.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasConfig()
Does this agent require a configuration?
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNamedObjectives(?Config $config=null)
Gets all named objectives The keys of the returned array are the commands.
A transformation is a function from one datatype to another.
A configuration for the setup.
Definition: Config.php:26