ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.InternalDomainService.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\BookingManager;
22 
29 
34 {
36 
40  protected static array $object_manager = [];
44  protected static array $schedule_manager = [];
45  protected ?\ilLogger $book_log = null;
48 
49  public function __construct(
51  InternalRepoService $repo_service,
52  InternalDataService $data_service
53  ) {
54  $this->repo_service = $repo_service;
55  $this->data_service = $data_service;
56  $this->initDomainServices($DIC);
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 log(): \ilLogger
71  {
72  if (is_null($this->book_log)) {
73  $this->book_log = $this->logger()->book();
74  }
75  return $this->book_log;
76  }
77 
78  public function preferences(
79  \ilObjBookingPool $pool
81  return new \ilBookingPreferencesManager(
82  $pool,
83  $this->repo_service->preferenceBasedBooking()
84  );
85  }
86 
87  public function process(): BookingProcessManager
88  {
89  return new BookingProcessManager(
90  $this->data_service,
91  $this->repo_service,
92  $this
93  );
94  }
95 
96  public function objects(int $pool_id): ObjectsManager
97  {
98  if (!isset(self::$object_manager[$pool_id])) {
99  self::$object_manager[$pool_id] = new ObjectsManager(
100  $this->data_service,
101  $this->repo_service,
102  $this,
103  $pool_id
104  );
105  }
106  return self::$object_manager[$pool_id];
107  }
108 
109  public function schedules(int $pool_id): ScheduleManager
110  {
111  if (!isset(self::$schedule_manager[$pool_id])) {
112  self::$schedule_manager[$pool_id] = new ScheduleManager(
113  $this->data_service,
114  $this->repo_service,
115  $this,
116  $pool_id
117  );
118  }
119  return self::$schedule_manager[$pool_id];
120  }
121 
122  public function reservations(): Reservations\ReservationManager
123  {
125  $this->data_service,
126  $this->repo_service,
127  $this
128  );
129  }
130 
131  public function participants(): Participants\ParticipantsManager
132  {
134  $this->data_service,
135  $this->repo_service,
136  $this
137  );
138  }
139 
140  public function objectSelection(int $pool_id): BookingProcess\ObjectSelectionManager
141  {
143  $this->data_service,
144  $this->repo_service,
145  $this,
146  $pool_id
147  );
148  }
149 
150  public function userEvent(): UserEvent
151  {
152  return new UserEvent($this);
153  }
154 
155 }
initDomainServices(\ILIAS\DI\Container $DIC)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Component logger with individual log levels by component id.
__construct(Container $DIC, InternalRepoService $repo_service, InternalDataService $data_service)