Repo class for booking objects.
More...
Repo class for booking objects.
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 28 of file class.ObjectsDBRepository.php.
◆ __construct()
ILIAS\BookingManager\Objects\ObjectsDBRepository::__construct |
( |
protected IRSSWrapper |
$wrapper, |
|
|
protected \ilDBInterface |
$db |
|
) |
| |
◆ clone()
ILIAS\BookingManager\Objects\ObjectsDBRepository::clone |
( |
int |
$from_id, |
|
|
int |
$to_id |
|
) |
| |
Definition at line 238 of file class.ObjectsDBRepository.php.
241 : void {
243 $to_rid = $this->wrapper->cloneResource($from_rid);
244 if ($to_rid !== "") {
245 $this->db->update(
246 "booking_object",
247 [
248 "obj_info_rid" => ["text", $to_rid]
249 ],
250 [
251 "booking_object_id" => ["integer", $to_id]
252 ]
253 );
254 }
256 $to_rid = $this->wrapper->cloneResource($from_rid);
257 if ($to_rid !== "") {
258 $this->db->update(
259 "booking_object",
260 [
261 "book_info_rid" => ["text", $to_rid]
262 ],
263 [
264 "booking_object_id" => ["integer", $to_id]
265 ]
266 );
267 }
268 }
getObjectInfoRidForBookingObjectId(int $booking_object_id)
getBookingInfoRidForBookingObjectId(int $booking_object_id)
◆ deleteBookingInfo()
ILIAS\BookingManager\Objects\ObjectsDBRepository::deleteBookingInfo |
( |
int |
$booking_object_id, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
Definition at line 184 of file class.ObjectsDBRepository.php.
184 : void
185 {
187 if ($rid !== "") {
188 $this->wrapper->deleteResource($rid, $stakeholder);
189 }
190 }
◆ deleteObjectInfo()
ILIAS\BookingManager\Objects\ObjectsDBRepository::deleteObjectInfo |
( |
int |
$booking_object_id, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
Definition at line 112 of file class.ObjectsDBRepository.php.
112 : void
113 {
115 if ($rid !== "") {
116 $this->wrapper->deleteResource($rid, $stakeholder);
117 }
118 }
◆ deliverBookingInfo()
ILIAS\BookingManager\Objects\ObjectsDBRepository::deliverBookingInfo |
( |
int |
$booking_object_id | ) |
|
◆ deliverObjectInfo()
ILIAS\BookingManager\Objects\ObjectsDBRepository::deliverObjectInfo |
( |
int |
$booking_object_id | ) |
|
◆ getBookingInfoFilename()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getBookingInfoFilename |
( |
int |
$booking_object_id | ) |
|
◆ getBookingInfoPath()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getBookingInfoPath |
( |
int |
$booking_object_id | ) |
|
◆ getBookingInfoRidForBookingObjectId()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getBookingInfoRidForBookingObjectId |
( |
int |
$booking_object_id | ) |
|
|
protected |
Definition at line 166 of file class.ObjectsDBRepository.php.
166 : string
167 {
168 $set = $this->db->queryF(
169 "SELECT book_info_rid FROM booking_object " .
170 " WHERE booking_object_id = %s ",
171 ["integer"],
172 [$booking_object_id]
173 );
174 $rec = $this->db->fetchAssoc($set);
175 return ($rec["book_info_rid"] ?? "");
176 }
◆ getColorNrForObject()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getColorNrForObject |
( |
int |
$book_obj_id | ) |
|
Definition at line 75 of file class.ObjectsDBRepository.php.
75 : int
76 {
77 if (!isset(self::$raw_data[$book_obj_id])) {
78 throw new \ilBookingPoolException("Data for booking object $book_obj_id not loaded.");
79 }
80 return (int) self::$color_number[$book_obj_id];
81 }
◆ getNrOfItemsForObject()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getNrOfItemsForObject |
( |
int |
$book_obj_id | ) |
|
Definition at line 67 of file class.ObjectsDBRepository.php.
67 : int
68 {
69 if (!isset(self::$raw_data[$book_obj_id])) {
70 throw new \ilBookingPoolException("Data for booking object $book_obj_id not loaded.");
71 }
72 return (int) self::$raw_data[$book_obj_id]["nr_of_items"];
73 }
◆ getObjectDataForPool()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getObjectDataForPool |
( |
int |
$pool_id | ) |
|
◆ getObjectInfoFilename()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getObjectInfoFilename |
( |
int |
$booking_object_id | ) |
|
◆ getObjectInfoPath()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getObjectInfoPath |
( |
int |
$booking_object_id | ) |
|
◆ getObjectInfoRidForBookingObjectId()
ILIAS\BookingManager\Objects\ObjectsDBRepository::getObjectInfoRidForBookingObjectId |
( |
int |
$booking_object_id | ) |
|
|
protected |
Definition at line 94 of file class.ObjectsDBRepository.php.
94 : string
95 {
96 $set = $this->db->queryF(
97 "SELECT obj_info_rid FROM booking_object " .
98 " WHERE booking_object_id = %s ",
99 ["integer"],
100 [$booking_object_id]
101 );
102 $rec = $this->db->fetchAssoc($set);
103 return ($rec["obj_info_rid"] ?? "");
104 }
◆ hasBookingInfo()
ILIAS\BookingManager\Objects\ObjectsDBRepository::hasBookingInfo |
( |
int |
$booking_object_id | ) |
|
◆ hasObjectInfo()
ILIAS\BookingManager\Objects\ObjectsDBRepository::hasObjectInfo |
( |
int |
$booking_object_id | ) |
|
◆ importBookingInfoFromLegacyUpload()
ILIAS\BookingManager\Objects\ObjectsDBRepository::importBookingInfoFromLegacyUpload |
( |
int |
$booking_object_id, |
|
|
array |
$file_input, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
Definition at line 215 of file class.ObjectsDBRepository.php.
219 : string {
220 $rcid = $this->wrapper->importFileFromLegacyUpload(
221 $file_input,
222 $stakeholder
223 );
224 if ($rcid !== "") {
225 $this->db->update(
226 "booking_object",
227 [
228 "book_info_rid" => ["text", $rcid]
229 ],
230 [
231 "booking_object_id" => ["integer", $booking_object_id]
232 ]
233 );
234 }
235 return $rcid;
236 }
◆ importObjectInfoFromLegacyUpload()
ILIAS\BookingManager\Objects\ObjectsDBRepository::importObjectInfoFromLegacyUpload |
( |
int |
$booking_object_id, |
|
|
array |
$file_input, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
Definition at line 143 of file class.ObjectsDBRepository.php.
147 : string {
148 $rcid = $this->wrapper->importFileFromLegacyUpload(
149 $file_input,
150 $stakeholder
151 );
152 if ($rcid !== "") {
153 $this->db->update(
154 "booking_object",
155 [
156 "obj_info_rid" => ["text", $rcid]
157 ],
158 [
159 "booking_object_id" => ["integer", $booking_object_id]
160 ]
161 );
162 }
163 return $rcid;
164 }
◆ loadDataOfPool()
ILIAS\BookingManager\Objects\ObjectsDBRepository::loadDataOfPool |
( |
int |
$pool_id | ) |
|
Definition at line 42 of file class.ObjectsDBRepository.php.
42 : void
43 {
45
46 if (isset(self::$pool_loaded[$pool_id]) && self::$pool_loaded[$pool_id]) {
47 return;
48 }
49
51 "SELECT * FROM booking_object " .
52 " WHERE pool_id = %s ORDER BY title ASC, booking_object_id ASC",
53 ["integer"],
54 [$pool_id]
55 );
56 self::$pool_objects[$pool_id] = [];
57 $cnt = 0;
58 while ($rec =
$db->fetchAssoc($set)) {
59 self::$raw_data[$rec["booking_object_id"]] = $rec;
61 self::$pool_objects[$pool_id][] = $rec;
62 $cnt++;
63 }
64 self::$pool_loaded[$pool_id] = true;
65 }
References ILIAS\$db, and ILIAS\BookingManager\Objects\ObjectsDBRepository\NR_OF_COLORS.
◆ $color_number
ILIAS\BookingManager\Objects\ObjectsDBRepository::$color_number = [] |
|
staticprotected |
◆ $pool_loaded
array ILIAS\BookingManager\Objects\ObjectsDBRepository::$pool_loaded = [] |
|
staticprotected |
◆ $pool_objects
ILIAS\BookingManager\Objects\ObjectsDBRepository::$pool_objects = [] |
|
staticprotected |
◆ $raw_data
array ILIAS\BookingManager\Objects\ObjectsDBRepository::$raw_data = [] |
|
staticprotected |
◆ NR_OF_COLORS
const ILIAS\BookingManager\Objects\ObjectsDBRepository::NR_OF_COLORS = 9 |
|
protected |
The documentation for this class was generated from the following file: