ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ParticipantsManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
31{
35
36 public function __construct(
40 ) {
41 $this->data = $data;
42 $this->repo = $repo;
43 $this->domain = $domain;
44 }
45
46 public function createIfNotExisting(
47 int $user_id,
48 int $pool_id
49 ): void {
50 if (!\ilObjUser::_exists($user_id)) {
51 throw new \ilException("User $user_id does not exist.");
52 }
53 if (!\ilObjBookingPool::_exists($pool_id)) {
54 throw new \ilException("Booking Pool $pool_id does not exist.");
55 }
56
57 $participant = new \ilBookingParticipant($user_id, $pool_id);
58 }
59
60 public function removeFromAll(int $user_id): void
61 {
62 $this->repo->participants()->removeFromAll($user_id);
63 }
64
65}
Author: Alexander Killing killing@leifos.de
__construct(InternalDataService $data, InternalRepoService $repo, InternalDomainService $domain)
User class.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
if(!file_exists('../ilias.ini.php'))