29 protected \ILIAS\BookingManager\InternalDomainService
$domain;
44 bool $a_call_by_reference =
true
48 $this->db =
$DIC->database();
52 $this->domain =
$DIC->bookingManager()->internal()->domain();
77 $new_id = parent::create();
80 $fields[
"booking_pool_id"] = array(
"integer", $new_id);
82 $ilDB->insert(
"booking_settings", $fields);
91 if (!parent::update()) {
100 array(
"booking_pool_id" => array(
"integer", $this->
getId()))
114 if ($this->
getId()) {
115 $set =
$ilDB->query(
'SELECT * FROM booking_settings' .
116 ' WHERE booking_pool_id = ' .
$ilDB->quote($this->getId(),
'integer'));
117 $row =
$ilDB->fetchAssoc($set);
126 $this->
setMessages((
bool) ((
int) ($row[
'messages'] ?? 0)));
140 "SELECT * FROM booking_settings " .
141 " WHERE reminder_status = %s " .
142 " AND reminder_day > %s ",
143 array(
"integer",
"integer",
"integer"),
165 "last_remind_ts" => array(
"integer", $a_ts)
167 "booking_pool_id" => array(
"integer", $a_obj_id)
171 public function delete():
bool
177 if ($this->referenced) {
179 $use_repo->deleteEntriesOfBookRefId($this->getRefId());
183 if (!parent::delete()) {
189 $ilDB->manipulate(
'DELETE FROM booking_settings' .
190 ' WHERE booking_pool_id = ' .
$ilDB->quote(
$id,
'integer'));
192 $ilDB->manipulate(
'DELETE FROM booking_schedule' .
193 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
196 $set =
$ilDB->query(
'SELECT booking_object_id FROM booking_object' .
197 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
198 while ($row =
$ilDB->fetchAssoc($set)) {
199 $objects[] = $row[
'booking_object_id'];
202 if (count($objects)) {
203 $ilDB->manipulate(
'DELETE FROM booking_reservation' .
204 ' WHERE ' .
$ilDB->in(
'object_id', $objects,
'',
'integer'));
207 $ilDB->manipulate(
'DELETE FROM booking_object' .
208 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
215 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
217 $schedule_manager = $this->domain->schedules($this->
getId());
219 if ($new_obj !==
null) {
228 $new_obj->setScheduleType($this->getScheduleType());
229 $new_obj->setPublicLog($this->hasPublicLog());
230 $new_obj->setOverallLimit($this->getOverallLimit());
231 $new_obj->setReminderStatus($this->getReminderStatus());
232 $new_obj->setReminderDay($this->getReminderDay());
233 $new_obj->setPreferenceNumber($this->getPreferenceNumber());
234 $new_obj->setPreferenceDeadline($this->getPreferenceDeadline());
235 $new_obj->setMessages($this->usesMessages());
238 if ($this->getScheduleType() === self::TYPE_FIX_SCHEDULE) {
240 foreach ($schedule_manager->getScheduleList() as $schedule_id => $title) {
242 $smap[$schedule_id] = $schedule->doClone($new_obj->getId());
249 $bobj->doClone($new_obj->getId(), $smap);
262 $this->messages = $a_value;
276 $this->public_log = $a_value;
281 return $this->public_log;
286 $this->schedule_type = $a_value;
291 return $this->schedule_type;
296 $this->reminder_status = $a_val;
301 return $this->reminder_status;
306 $this->reminder_day = $a_val;
311 return $this->reminder_day;
316 $this->preference_nr = $a_val;
321 return $this->preference_nr;
329 $this->pref_deadline = $a_val;
337 return $this->pref_deadline;
346 $this->overall_limit = $a_value;
351 return $this->overall_limit;
360 $this->reservation_period = $a_value;
365 return $this->reservation_period;
380 foreach ($recs as $record_obj) {
382 $field_id = $def->getFieldId();
383 $fields[$field_id] = array(
385 "title" => $def->getTitle(),
386 "type" => $def->getType()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static getInstancesByRecordId( $a_record_id, $a_only_searchable=false, string $language='')
Get definitions by record id.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
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...
static _getInstance(int $a_copy_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setReminderDay(int $a_val)
setPreferenceNumber(int $a_val)
ILIAS BookingManager InternalDomainService $domain
static writeLastReminderTimestamp(int $a_obj_id, int $a_ts)
__construct(int $a_id=0, bool $a_call_by_reference=true)
static getAdvancedMDFields(int $a_ref_id)
getDBFields()
Parse properties for sql statements.
create()
note: title, description and type should be set when this function is called
const TYPE_NO_SCHEDULE_PREFERENCES
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
setPreferenceDeadline(int $a_val)
setReservationFilterPeriod(?int $a_value=null)
Set reservation filter period default.
setReminderStatus(int $a_val)
setScheduleType(int $a_value)
setMessages(bool $a_value=true)
setOverallLimit(?int $a_value=null)
Set overall / global booking limit.
getReservationFilterPeriod()
setPublicLog(bool $a_value=true)
Toggle public log property.
static getPoolsWithReminders()
Get pools with reminders.
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 lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
update(string $table_name, array $values, array $where)
@description $where MUST contain existing columns only.
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc