ILIAS
release_8 Revision v8.19
|
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...
Public Member Functions | |
__construct (ilObjBookingPool $pool, ilBookingPrefBasedBookGatewayRepository $book_repo, ?int $current_time=null, int $bookings_per_user=self::BOOKINGS_PER_USER_DEFAULT) | |
isGivingPreferencesPossible () | |
Can participants hand in preferences. More... | |
isPreferenceDeadlineReached () | |
Can participants hand in preferences. More... | |
storeBookings (ilBookingPreferences $preferences, ?array $booking_object_ids=null) | |
Calculate and store bookings. More... | |
readBookings () | |
calculateBookings (ilBookingPreferences $preferences, ?array $booking_object_ids=null, ?array $availability=null) | |
Calculate bookings. More... | |
hasRun () | |
resetRun () | |
Data Fields | |
const | BOOKINGS_PER_USER_DEFAULT = 1 |
Protected Member Functions | |
addBooking (array &$bookings, array &$preferences, array &$availability, int $user_id, int $book_obj_id) | |
selectRandomEntry (array $items) | |
Select a random entry of an array. More... | |
getUsersForObject (array $preferences, int $sel_obj_id) | |
Get users for object. More... | |
calculatePopularity (array $booking_object_ids, array $preferences) | |
Calculate popularity (number of preferences each object got from users) More... | |
getObjectWithLowestPopularity (array $popularity, array $availability) | |
Get an availabe object with lowest popularity > 0. More... | |
removePreference (int $user_id, int $obj_id, array $preferences) | |
Remove a preference from the preference array. More... | |
removeObjectFromPreferences (int $obj_id, array $preferences) | |
Remove an object from the preference array. More... | |
removeUserFromPreferences (int $user_id, array $preferences) | |
Remove user from preference array. More... | |
chooseRandomUserFromPreferences (array $preferences) | |
Choose random user from the preference array. More... | |
getMinimalAssignedEntryForUser (array $booking_object_ids, array $bookings, array $user_preferences, array $availability) | |
Get an available object within the preferences (if no preferences left, even outside of preferences) of a user that is currently minimal assigned. More... | |
Protected Attributes | |
ilObjBookingPool | $pool |
int | $current_time |
int | $bookings_per_user |
ilBookingPrefBasedBookGatewayRepository | $book_repo |
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Booking preferences business logic
Definition at line 23 of file class.ilBookingPreferencesManager.php.
ilBookingPreferencesManager::__construct | ( | ilObjBookingPool | $pool, |
ilBookingPrefBasedBookGatewayRepository | $book_repo, | ||
?int | $current_time = null , |
||
int | $bookings_per_user = self::BOOKINGS_PER_USER_DEFAULT |
||
) |
Definition at line 32 of file class.ilBookingPreferencesManager.php.
References $book_repo, $bookings_per_user, and $pool.
|
protected |
Definition at line 170 of file class.ilBookingPreferencesManager.php.
References removeObjectFromPreferences(), removePreference(), and removeUserFromPreferences().
Referenced by calculateBookings().
ilBookingPreferencesManager::calculateBookings | ( | ilBookingPreferences | $preferences, |
?array | $booking_object_ids = null , |
||
?array | $availability = null |
||
) |
Calculate bookings.
int[] | $booking_object_ids |
ilBookingCalculationException |
Definition at line 95 of file class.ilBookingPreferencesManager.php.
References $i, addBooking(), calculatePopularity(), chooseRandomUserFromPreferences(), ilBookingObject\getList(), getMinimalAssignedEntryForUser(), ilBookingReservation\getNumAvailablesNoSchedule(), getObjectWithLowestPopularity(), ilBookingPreferences\getPreferences(), getUsersForObject(), isPreferenceDeadlineReached(), removeObjectFromPreferences(), removeUserFromPreferences(), and selectRandomEntry().
Referenced by storeBookings().
|
protected |
Calculate popularity (number of preferences each object got from users)
Definition at line 222 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings().
|
protected |
Choose random user from the preference array.
Definition at line 304 of file class.ilBookingPreferencesManager.php.
References selectRandomEntry().
Referenced by calculateBookings().
|
protected |
Get an available object within the preferences (if no preferences left, even outside of preferences) of a user that is currently minimal assigned.
int[] | $booking_object_ids |
int[][] | $bookings |
int[] | $user_preferences |
int[] | $availability |
Definition at line 324 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings().
|
protected |
Get an availabe object with lowest popularity > 0.
Definition at line 243 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings().
|
protected |
Get users for object.
Definition at line 203 of file class.ilBookingPreferencesManager.php.
References ILIAS\Repository\int().
Referenced by calculateBookings().
ilBookingPreferencesManager::hasRun | ( | ) |
Definition at line 353 of file class.ilBookingPreferencesManager.php.
ilBookingPreferencesManager::isGivingPreferencesPossible | ( | ) |
Can participants hand in preferences.
Definition at line 49 of file class.ilBookingPreferencesManager.php.
References $current_time, and ilObjBookingPool\TYPE_NO_SCHEDULE_PREFERENCES.
ilBookingPreferencesManager::isPreferenceDeadlineReached | ( | ) |
Can participants hand in preferences.
Definition at line 58 of file class.ilBookingPreferencesManager.php.
References $current_time, and ilObjBookingPool\TYPE_NO_SCHEDULE_PREFERENCES.
Referenced by calculateBookings().
ilBookingPreferencesManager::readBookings | ( | ) |
Definition at line 82 of file class.ilBookingPreferencesManager.php.
References $i, and ilBookingObject\getList().
|
protected |
Remove an object from the preference array.
Definition at line 275 of file class.ilBookingPreferencesManager.php.
References $i.
Referenced by addBooking(), and calculateBookings().
|
protected |
Remove a preference from the preference array.
Definition at line 259 of file class.ilBookingPreferencesManager.php.
References $i.
Referenced by addBooking().
|
protected |
Remove user from preference array.
Definition at line 291 of file class.ilBookingPreferencesManager.php.
Referenced by addBooking(), and calculateBookings().
ilBookingPreferencesManager::resetRun | ( | ) |
Definition at line 358 of file class.ilBookingPreferencesManager.php.
|
protected |
Select a random entry of an array.
Definition at line 193 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings(), and chooseRandomUserFromPreferences().
ilBookingPreferencesManager::storeBookings | ( | ilBookingPreferences | $preferences, |
?array | $booking_object_ids = null |
||
) |
Calculate and store bookings.
ilBookingPreferences | $preferences | |
?int[] | $booking_object_ids |
ilBookingCalculationException |
Definition at line 71 of file class.ilBookingPreferencesManager.php.
References calculateBookings().
|
protected |
Definition at line 30 of file class.ilBookingPreferencesManager.php.
Referenced by __construct().
|
protected |
Definition at line 29 of file class.ilBookingPreferencesManager.php.
Referenced by __construct().
|
protected |
Definition at line 28 of file class.ilBookingPreferencesManager.php.
Referenced by isGivingPreferencesPossible(), and isPreferenceDeadlineReached().
|
protected |
Definition at line 27 of file class.ilBookingPreferencesManager.php.
Referenced by __construct().
const ilBookingPreferencesManager::BOOKINGS_PER_USER_DEFAULT = 1 |
Definition at line 25 of file class.ilBookingPreferencesManager.php.