29 ILIAS\BookingManager\InternalDataService $data,
47 "SELECT * FROM booking_preferences " .
48 " WHERE book_pool_id = %s ",
54 if (!isset($preferences[$rec[
"user_id"]]) || !in_array($rec[
"book_obj_id"], $preferences[$rec[
"user_id"]],
true)) {
55 $preferences[$rec[
"user_id"]][] = $rec[
"book_obj_id"];
58 return $this->data->preferences($preferences);
71 "SELECT * FROM booking_preferences " .
72 " WHERE book_pool_id = %s " .
74 array(
"integer",
"integer"),
75 array($a_pool_id, $a_user_id)
79 if (!isset($preferences[$rec[
"user_id"]]) || !in_array($rec[
"book_obj_id"], $preferences[$rec[
"user_id"]],
true)) {
80 $preferences[$rec[
"user_id"]][] = $rec[
"book_obj_id"];
83 return $this->data->preferences($preferences);
96 "DELETE FROM booking_preferences WHERE " .
102 foreach ($preferences as
$user_id => $obj_ids) {
103 if (is_array($obj_ids) &&
$user_id > 0) {
104 foreach ($obj_ids as $obj_id) {
105 $db->
insert(
"booking_preferences", array(
106 "book_pool_id" => array(
"integer", $a_pool_id),
107 "user_id" => array(
"integer",
$user_id),
108 "book_obj_id" => array(
"integer", $obj_id),
126 "DELETE FROM booking_preferences WHERE " .
127 " book_pool_id = %s" .
129 array(
"integer",
"integer"),
130 array($a_pool_id, $a_user_id)
134 if (is_array($obj_ids) && $user_id === $a_user_id) {
135 foreach ($obj_ids as $obj_id) {
136 $db->
insert(
"booking_preferences", array(
137 "book_pool_id" => array(
"integer", $a_pool_id),
138 "user_id" => array(
"integer", $user_id),
139 "book_obj_id" => array(
"integer", $obj_id),
insert(string $table_name, array $values)
manipulateF(string $query, array $types, array $values)
fetchAssoc(ilDBStatement $statement)
Interface Observer Contains several chained tasks and infos about them.
__construct(ILIAS\BookingManager\InternalDataService $data, ?ilDBInterface $db=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPreferences(int $a_pool_id)
Get booking preferences for a pool id.
savePreferencesOfUser(int $a_pool_id, int $a_user_id, ilBookingPreferences $preferences)
Save all preferences of a user for a pool.
getPreferences()
Get user preferences.
getPreferencesOfUser(int $a_pool_id, int $a_user_id)
Get booking preferences for a pool id.
queryF(string $query, array $types, array $values)
ILIAS BookingManager InternalDataService $data
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
savePreferences(int $a_pool_id, ilBookingPreferences $preferences)
Save all preferences of a pool.