ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.InternalDomainService.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\Awareness;
22 
25 
30 {
32 
33  protected Container $dic;
37  protected static array $managers = array();
39  protected static array $collectors = array();
40 
41  public function __construct(
43  InternalRepoService $repo_service,
44  InternalDataService $data_service
45  ) {
46  $this->repo_service = $repo_service;
47  $this->data_service = $data_service;
48  $this->initDomainServices($DIC);
49  $this->dic = $DIC;
50  }
51 
52  /*
53  public function access(int $ref_id, int $user_id) : Access\AccessManager
54  {
55  return new Access\AccessManager(
56  $this,
57  $this->access,
58  $ref_id,
59  $user_id
60  );
61  }*/
62 
63  public function widget(int $user_id, int $ref_id = 0): WidgetManager
64  {
65  if (!isset(self::$managers[$user_id])) {
66  self::$managers[$user_id] = new WidgetManager(
67  $user_id,
68  $ref_id,
69  $this->data_service,
70  $this->repo_service,
71  $this
72  );
73  }
74  return self::$managers[$user_id];
75  }
76 
77  public function admin(int $ref_id): AdminManager
78  {
79  return new AdminManager(
80  $ref_id,
81  $this->data_service,
82  $this
83  );
84  }
85 
86  public function awarenessSettings(): \ilSetting
87  {
88  return new \ilSetting("awrn");
89  }
90 
91  public function userProvider(): User\ProviderFactory
92  {
93  return new User\ProviderFactory($this->dic);
94  }
95 
96  public function userCollector(int $user_id, int $ref_id = 0): User\Collector
97  {
98  if (!isset(self::$collectors[$user_id])) {
99  self::$collectors[$user_id] = new User\Collector(
100  $user_id,
101  $ref_id,
102  $this->data_service,
103  $this->repo_service,
104  $this
105  );
106  }
107  return self::$collectors[$user_id];
108  }
109 }
Collects users from all providers.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initDomainServices(\ILIAS\DI\Container $DIC)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
High level business class, interface to front ends.
__construct(Container $DIC, InternalRepoService $repo_service, InternalDataService $data_service)
Administrate awareness tool.