|
ILIAS
release_7 Revision v7.30-3-g800a261c036
|
Booking preferences business logic. More...
Collaboration diagram for ilBookingPreferencesManager:Public Member Functions | |
| __construct (ilObjBookingPool $pool, ilBookingPrefBasedBookGatewayRepository $book_repo, int $current_time=null, $bookings_per_user=self::BOOKINGS_PER_USER_DEFAULT) | |
| Constructor. More... | |
| isGivingPreferencesPossible () | |
| Can participants hand in preferences. More... | |
| isPreferenceDeadlineReached () | |
| Can participants hand in preferences. More... | |
| storeBookings ($preferences, $booking_object_ids=null) | |
| Calculate and store bookings. More... | |
| readBookings () | |
| Read the bookings. More... | |
| calculateBookings (ilBookingPreferences $preferences, $booking_object_ids=null, $availability=null) | |
| Calculate bookings. More... | |
| hasRun () | |
| resetRun () | |
Data Fields | |
| const | BOOKINGS_PER_USER_DEFAULT = 1 |
Protected Member Functions | |
| addBooking (&$bookings, &$preferences, &$availability, $user_id, $book_obj_id) | |
| Add booking. More... | |
| selectRandomEntry ($items) | |
| Select a random entry of an array. More... | |
| getUsersForObject ($preferences, $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 ($popularity, $availability) | |
| Get an availabe object with lowest popularity > 0. More... | |
| removePreference ($user_id, $obj_id, $preferences) | |
| Remove a preference from the preference array. More... | |
| removeObjectFromPreferences ($obj_id, $preferences) | |
| Remove an object from the preference array. More... | |
| removeUserFromPreferences ($user_id, $preferences) | |
| Remove user from preference array. More... | |
| chooseRandomUserFromPreferences ($preferences) | |
| Choose random user from the preference array. More... | |
| getMinimalAssignedEntryForUser ($booking_object_ids, $bookings, $user_preferences, $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 | |
| $pool | |
| $current_time | |
| $bookings_per_user | |
| $book_repo | |
Booking preferences business logic.
Definition at line 10 of file class.ilBookingPreferencesManager.php.
| ilBookingPreferencesManager::__construct | ( | ilObjBookingPool | $pool, |
| ilBookingPrefBasedBookGatewayRepository | $book_repo, | ||
| int | $current_time = null, |
||
$bookings_per_user = self::BOOKINGS_PER_USER_DEFAULT |
|||
| ) |
Constructor.
| ilObjBookingPool | $pool | |
| int | null | $current_time |
Definition at line 39 of file class.ilBookingPreferencesManager.php.
References $book_repo, $bookings_per_user, $current_time, and $pool.
|
protected |
Add booking.
| $bookings | |
| $preferences | |
| $availability | |
| $user_id | |
| $book_obj_id |
Definition at line 200 of file class.ilBookingPreferencesManager.php.
References removeObjectFromPreferences(), removePreference(), and removeUserFromPreferences().
Referenced by calculateBookings().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBookingPreferencesManager::calculateBookings | ( | ilBookingPreferences | $preferences, |
$booking_object_ids = null, |
|||
$availability = null |
|||
| ) |
Calculate bookings.
| ilBookingPreferences | $preferences | |
| int[] | $booking_object_ids |
| ilBookingCalculationException |
Definition at line 115 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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Calculate popularity (number of preferences each object got from users)
| array | $booking_object_ids | |
| array | $preferences |
Definition at line 256 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings().
Here is the caller graph for this function:
|
protected |
Choose random user from the preference array.
| array | $preferences |
Definition at line 347 of file class.ilBookingPreferencesManager.php.
References selectRandomEntry().
Referenced by calculateBookings().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 |
Definition at line 362 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings().
Here is the caller graph for this function:
|
protected |
Get an availabe object with lowest popularity > 0.
| array | $popularity |
Definition at line 278 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings().
Here is the caller graph for this function:
|
protected |
Get users for object.
| $preferences | |
| $sel_obj_id |
Definition at line 235 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings().
Here is the caller graph for this function:| ilBookingPreferencesManager::hasRun | ( | ) |
Definition at line 388 of file class.ilBookingPreferencesManager.php.
| ilBookingPreferencesManager::isGivingPreferencesPossible | ( | ) |
Can participants hand in preferences.
Definition at line 58 of file class.ilBookingPreferencesManager.php.
References ilObjBookingPool\TYPE_NO_SCHEDULE_PREFERENCES.
| ilBookingPreferencesManager::isPreferenceDeadlineReached | ( | ) |
Can participants hand in preferences.
Definition at line 72 of file class.ilBookingPreferencesManager.php.
References ilObjBookingPool\TYPE_NO_SCHEDULE_PREFERENCES.
Referenced by calculateBookings().
Here is the caller graph for this function:| ilBookingPreferencesManager::readBookings | ( | ) |
Read the bookings.
Definition at line 99 of file class.ilBookingPreferencesManager.php.
References $i, and ilBookingObject\getList().
Here is the call graph for this function:
|
protected |
Remove an object from the preference array.
| int | $user_id | |
| int | $obj_id | |
| array | $preferences |
Definition at line 315 of file class.ilBookingPreferencesManager.php.
References $i.
Referenced by addBooking(), and calculateBookings().
Here is the caller graph for this function:
|
protected |
Remove a preference from the preference array.
| int | $user_id | |
| int | $obj_id | |
| array | $preferences |
Definition at line 297 of file class.ilBookingPreferencesManager.php.
References $i.
Referenced by addBooking().
Here is the caller graph for this function:
|
protected |
Remove user from preference array.
| int | $user_id | |
| array | $preferences |
Definition at line 333 of file class.ilBookingPreferencesManager.php.
Referenced by addBooking(), and calculateBookings().
Here is the caller graph for this function:| ilBookingPreferencesManager::resetRun | ( | ) |
Definition at line 393 of file class.ilBookingPreferencesManager.php.
|
protected |
Select a random entry of an array.
return
Definition at line 221 of file class.ilBookingPreferencesManager.php.
Referenced by calculateBookings(), and chooseRandomUserFromPreferences().
Here is the caller graph for this function:| ilBookingPreferencesManager::storeBookings | ( | $preferences, | |
$booking_object_ids = null |
|||
| ) |
Calculate and store bookings.
| ilBookingPreferences | $preferences | |
| int[] | $booking_object_ids |
| ilBookingCalculationException |
Definition at line 88 of file class.ilBookingPreferencesManager.php.
References calculateBookings().
Here is the call graph for this function:
|
protected |
Definition at line 32 of file class.ilBookingPreferencesManager.php.
Referenced by __construct().
|
protected |
Definition at line 27 of file class.ilBookingPreferencesManager.php.
Referenced by __construct().
|
protected |
Definition at line 22 of file class.ilBookingPreferencesManager.php.
Referenced by __construct().
|
protected |
Definition at line 17 of file class.ilBookingPreferencesManager.php.
Referenced by __construct().
| const ilBookingPreferencesManager::BOOKINGS_PER_USER_DEFAULT = 1 |
Definition at line 12 of file class.ilBookingPreferencesManager.php.