46 if (isset(self::$pool_loaded[$pool_id]) && self::$pool_loaded[$pool_id]) {
51 "SELECT * FROM booking_object " .
52 " WHERE pool_id = %s ORDER BY title ASC, booking_object_id ASC",
56 self::$pool_objects[$pool_id] = [];
58 while ($rec =
$db->fetchAssoc($set)) {
59 self::$raw_data[$rec[
"booking_object_id"]] = $rec;
60 self::$color_number[$rec[
"booking_object_id"]] = ($cnt % self::NR_OF_COLORS) + 1;
61 self::$pool_objects[$pool_id][] = $rec;
64 self::$pool_loaded[$pool_id] =
true;
69 if (!isset(self::$raw_data[$book_obj_id])) {
70 throw new \ilBookingPoolException(
"Data for booking object $book_obj_id not loaded.");
72 return (
int) self::$raw_data[$book_obj_id][
"nr_of_items"];
77 if (!isset(self::$raw_data[$book_obj_id])) {
78 throw new \ilBookingPoolException(
"Data for booking object $book_obj_id not loaded.");
80 return (
int) self::$color_number[$book_obj_id];
87 return self::$pool_objects[$pool_id] ?? [];
96 $set = $this->db->queryF(
97 "SELECT obj_info_rid FROM booking_object " .
98 " WHERE booking_object_id = %s ",
102 $rec = $this->db->fetchAssoc($set);
103 return ($rec[
"obj_info_rid"] ??
"");
109 return ($rid !==
"");
116 $this->wrapper->deleteResource($rid);
123 $this->wrapper->getResourcePath($rid);
129 $this->wrapper->deliverFile($rid);
136 $info = $this->wrapper->getResourceInfo($rid);
137 return $info->getTitle();
144 int $booking_object_id,
148 $rcid = $this->wrapper->importFileFromLegacyUpload(
156 "obj_info_rid" => [
"text", $rcid]
159 "booking_object_id" => [
"integer", $booking_object_id]
168 $set = $this->db->queryF(
169 "SELECT book_info_rid FROM booking_object " .
170 " WHERE booking_object_id = %s ",
174 $rec = $this->db->fetchAssoc($set);
175 return ($rec[
"book_info_rid"] ??
"");
181 return ($rid !==
"");
188 $this->wrapper->deleteResource($rid);
195 $this->wrapper->deliverFile($rid);
201 $this->wrapper->getResourcePath($rid);
208 $info = $this->wrapper->getResourceInfo($rid);
209 return $info->getTitle();
216 int $booking_object_id,
220 $rcid = $this->wrapper->importFileFromLegacyUpload(
228 "book_info_rid" => [
"text", $rcid]
231 "booking_object_id" => [
"integer", $booking_object_id]
243 $to_rid = $this->wrapper->cloneResource($from_rid);
244 if ($to_rid !==
"") {
248 "obj_info_rid" => [
"text", $to_rid]
251 "booking_object_id" => [
"integer", $to_id]
256 $to_rid = $this->wrapper->cloneResource($from_rid);
257 if ($to_rid !==
"") {
261 "book_info_rid" => [
"text", $to_rid]
264 "booking_object_id" => [
"integer", $to_id]
getObjectInfoFilename(int $booking_object_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static array $pool_loaded
getBookingInfoRidForBookingObjectId(int $booking_object_id)
__construct(protected IRSSWrapper $wrapper, protected \ilDBInterface $db)
importObjectInfoFromLegacyUpload(int $booking_object_id, array $file_input, ResourceStakeholder $stakeholder)
deliverObjectInfo(int $booking_object_id)
getObjectInfoRidForBookingObjectId(int $booking_object_id)
getObjectDataForPool(int $pool_id)
importBookingInfoFromLegacyUpload(int $booking_object_id, array $file_input, ResourceStakeholder $stakeholder)
hasObjectInfo(int $booking_object_id)
deliverBookingInfo(int $booking_object_id)
deleteBookingInfo(int $booking_object_id)
getBookingInfoPath(int $booking_object_id)
clone(int $from_id, int $to_id)
deleteObjectInfo(int $booking_object_id)
loadDataOfPool(int $pool_id)
Interface ResourceStakeholder.
hasBookingInfo(int $booking_object_id)
getObjectInfoPath(int $booking_object_id)
getColorNrForObject(int $book_obj_id)
Repo class for booking objects.
getBookingInfoFilename(int $booking_object_id)
getNrOfItemsForObject(int $book_obj_id)