ILIAS  trunk Revision v13.0_alpha-52-g21c366bbdd4
ObjectEvent.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ilObject;
26
28{
29 public function handleDeletion(array $booking_pool_ref_ids): void
30 {
31 foreach (array_unique($booking_pool_ref_ids) as $booking_pool_ref_id) {
32 if (!is_numeric($booking_pool_ref_id)) {
33 continue;
34 }
35 $booking_pool_ref_id = (int) $booking_pool_ref_id;
36
37 if (!ilObject::_exists($booking_pool_ref_id, true, 'book')) {
38 continue;
39 }
40
41 $booking_pool = new ilObjBookingPool($booking_pool_ref_id, true);
42
43 foreach (ilBookingObject::getList($booking_pool->getId()) as $booking_object) {
44 $booking_object_id = $booking_object['booking_object_id'] ?? null;
45 if ($booking_object_id === null) {
46 continue;
47 }
48
49 (new ilBookingObject($booking_object_id))->deleteReservationsAndCalEntries($booking_object_id);
50 }
51 }
52 }
53}
handleDeletion(array $booking_pool_ref_ids)
Definition: ObjectEvent.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getList(int $a_pool_id, ?string $a_title=null)
Get list of booking objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObject Basic functions for all objects.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...