ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.InternalDomainService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Awareness;
22 
25 
30 {
32 
33  protected Container $dic;
36 
37  protected \ilUserActionProviderFactory $user_action_provider_factory;
38  protected \ilUserActionAdmin $user_action_admin;
39 
41  protected static array $managers = array();
43  protected static array $collectors = array();
44 
45  public function __construct(
47  InternalRepoService $repo_service,
48  InternalDataService $data_service
49  ) {
50  $this->repo_service = $repo_service;
51  $this->data_service = $data_service;
52  $this->initDomainServices($DIC);
53  $this->dic = $DIC;
54 
55  $this->user_action_provider_factory = new \ilUserActionProviderFactory();
56  $this->user_action_admin = new \ilUserActionAdmin($DIC['ilDB']);
57  }
58 
59  /*
60  public function access(int $ref_id, int $user_id) : Access\AccessManager
61  {
62  return new Access\AccessManager(
63  $this,
64  $this->access,
65  $ref_id,
66  $user_id
67  );
68  }*/
69 
70  public function widget(int $user_id, int $ref_id = 0): WidgetManager
71  {
72  if (!isset(self::$managers[$user_id])) {
73  self::$managers[$user_id] = new WidgetManager(
74  $user_id,
75  $ref_id,
76  $this->data_service,
77  $this->repo_service,
78  $this,
79  $this->user_action_provider_factory,
80  $this->user_action_admin
81  );
82  }
83  return self::$managers[$user_id];
84  }
85 
86  public function admin(int $ref_id): AdminManager
87  {
88  return new AdminManager(
89  $ref_id,
90  $this->data_service,
91  $this
92  );
93  }
94 
95  public function awarenessSettings(): \ilSetting
96  {
97  return new \ilSetting("awrn");
98  }
99 
100  public function userProvider(): User\ProviderFactory
101  {
102  return new User\ProviderFactory($this->dic);
103  }
104 
105  public function userCollector(int $user_id, int $ref_id = 0): User\Collector
106  {
107  if (!isset(self::$collectors[$user_id])) {
108  self::$collectors[$user_id] = new User\Collector(
109  $user_id,
110  $ref_id,
111  $this->data_service,
112  $this->repo_service,
113  $this
114  );
115  }
116  return self::$collectors[$user_id];
117  }
118 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initDomainServices(\ILIAS\DI\Container $DIC)
$ref_id
Definition: ltiauth.php:65
High level business class, interface to front ends.
global $DIC
Definition: shib_login.php:26
__construct(Container $DIC, InternalRepoService $repo_service, InternalDataService $data_service)
ilUserActionProviderFactory $user_action_provider_factory
Administrate awareness tool.