|
| static | findRoomsByRequest (ResourceRequest $request) |
| |
| static | userHasRooms (User $user, $level='user', $permanent_only=false, $time=null, $sql_conditions='', $sql_condition_parameters=[]) |
| |
| static | countUserRooms (User $user, $level='user', $permanent_only=false, $time=null, $sql_conditions='', $sql_condition_parameters=[]) |
| |
| static | getUserRooms (User $user, $level='user', $permanent_only=false, $time=null, $sql_conditions='', $sql_condition_parameters=[]) |
| |
| static | createRoomBookingsByRequest (Room $room, RoomRequest $room_request, User $user, $notify_teachers=true) |
| |
| static | getBookingIntervalsForRoom (Room $room, DateTime $begin, DateTime $end, $booking_types=[0, 1, 2], $building_booking_types=[0, 1, 2], $exclude_canceled_intervals=true) |
| |
| static | findRooms ( $room_name='', $location_id=null, $building_id=null, $properties=[], $time_ranges=[], $order_by=null, $only_requestable_rooms=true) |
| |
| static | findOverbookedRoomBookings (DateTime $begin, DateTime $end) |
| |
| static | getAllRoomPropertyDefinitions ( $only_searchable=false, $excluded_properties=[]) |
| |
The RoomManager class contains methods that simplify the handling of rooms which are one type of resources.
◆ countUserRooms()
| static countUserRooms |
( |
User |
$user, |
|
|
|
$level = 'user', |
|
|
|
$permanent_only = false, |
|
|
|
$time = null, |
|
|
|
$sql_conditions = '', |
|
|
|
$sql_condition_parameters = [] |
|
) |
| |
|
static |
Counts all rooms for which the specified user has permanent or temporary permissions. Root users and global resource admins get the amount of rooms in the Stud.IP system as result.
- Parameters
-
| User | $user | The user whose rooms shall be retrieved. |
| string | $level | The minimum permission level the user must have on a room so that it will be included in the result set. Defaults to the "user" permission level. |
| bool | $permanent_only | Whether to count only rooms with permanent permissions (true) or rooms with permanent and temporary permissions (false). Defaults to false. |
| DateTime | int | null | $time | The timestamp for the check on temporary permissions. If this parameter is not set the current timestamp will be used. |
| string | $sql_conditions | An optional SQL condition that will be placed in the WHERE block of the SQL query to filter the result set. |
| array | $sql_condition_parameters | An optional associative array for the sql condition parameter containing variable parameters that shall be used in the SQL query. |
◆ createRoomBookingsByRequest()
- Parameters
-
| bool | $notify_teachers | True, if the teachers of the course where the room request belongs to shall be notified, false otherwise. This parameter is only useful for room requests made for courses and their dates. |
◆ findOverbookedRoomBookings()
| static findOverbookedRoomBookings |
( |
DateTime |
$begin, |
|
|
DateTime |
$end |
|
) |
| |
|
static |
Searches for room bookings where the room is overbooked in the specified time range. A room is overbooked if a resource booking exists for that room which is associated with a course and the amount of course participants is higher than the amount of seats in the room.
- Parameters
-
| DateTime | $begin | The begin of the time range. |
| DateTime | $end | The end of the time range. |
- Returns
- SimpleORMapCollection A collection of overbooked room bookings as ResourceBooking objects.
◆ findRooms()
| static findRooms |
( |
|
$room_name = '', |
|
|
|
$location_id = null, |
|
|
|
$building_id = null, |
|
|
|
$properties = [], |
|
|
|
$time_ranges = [], |
|
|
|
$order_by = null, |
|
|
|
$only_requestable_rooms = true |
|
) |
| |
|
static |
Finds rooms by name, time range and which (at your option) meet the requirements specified by other properties. If a property isn't specified it won't be searched for.
- Parameters
-
| string | $name | The name of the room. |
| string | $location_id | The ID of the location where the room shall lie in. |
| string[] | $properties | An array of properties and their desired states. This array has the following structure: $properties['property_name'] = 'property_state'; The array keys specify the property names, the entries of the array specify the desired state. Only the seats property may be a single value or an array with two entries. In the first case the room must have at least $seats seats. In the latter case the room must have between $seats[0] and $seats[1] seats. There are special pseudo properties that are handled by this array:
- room_category_id: The id of a resource category that has 'Room' as class name.
|
| Array | $time_ranges | Optional time ranges where the rooms have to be available. The format of the array is the following: [ [ 'begin' => (begin timestamp or DateTime object), 'end' => (end timestamp or DateTime object) ] ] |
| string | $order_by | An optional SQL snippet specifying the order of the results. Defaults to null (no sorting). |
| bool | $only_requestable_rooms | Whether the search shall be limited to requestable rooms only (true) or not (false). |
- Returns
- Room[] An array containing Room objects for all rooms which are available in the given time range and which have the (optionally) set properties).
◆ findRoomsByRequest()
◆ getAllRoomPropertyDefinitions()
| static getAllRoomPropertyDefinitions |
( |
|
$only_searchable = false, |
|
|
|
$excluded_properties = [] |
|
) |
| |
|
static |
Retrieves all properties that are bound to room resource categories or room resources directly.
- Parameters
-
| bool | $only_searchable | Whether only searchable properties shall be returned (true) or all properties shall be returned (false). Defaults to false. |
| string[] | $excluded_properties | An array containing the names of the properties that shall be excluded from the result set. |
- Returns
- ResourcePropertyDefinition[] An array of ResourcePropertyDefinition objects.
◆ getBookingIntervalsForRoom()
| static getBookingIntervalsForRoom |
( |
Room |
$room, |
|
|
DateTime |
$begin, |
|
|
DateTime |
$end, |
|
|
|
$booking_types = [0, 1, 2], |
|
|
|
$building_booking_types = [0, 1, 2], |
|
|
|
$exclude_canceled_intervals = true |
|
) |
| |
|
static |
◆ getUserRooms()
| static getUserRooms |
( |
User |
$user, |
|
|
|
$level = 'user', |
|
|
|
$permanent_only = false, |
|
|
|
$time = null, |
|
|
|
$sql_conditions = '', |
|
|
|
$sql_condition_parameters = [] |
|
) |
| |
|
static |
Retrieves all rooms for which the specified user has permanent or temporary permissions. Root users and global resource admins get a list of all rooms stored in the Stud.IP system.
- Parameters
-
| User | $user | The user whose rooms shall be retrieved. |
| bool | $permanent_only | Whether to retrieve only rooms with permanent permissions (true) or rooms with permanent and temporary permissions (false). Defaults to false. |
| string | $level | The minimum permission level the user must have on a room so that it will be included in the result set. |
| string | $sql_conditions | An optional SQL condition that will be placed in the WHERE block of the SQL query to filter the result set. |
| array | $sql_condition_parameters | An optional associative array for the sql condition parameter containing variable parameters that shall be used in the SQL query. |
| DateTime | int | null | $time | The timestamp for the check on temporary permissions. If this parameter is not set the current timestamp will be used. |
- Returns
- Room[]
◆ getUserRoomsSqlData()
| static getUserRoomsSqlData |
( |
User |
$user, |
|
|
|
$level = 'user', |
|
|
|
$permanent_only = false, |
|
|
|
$time = null, |
|
|
|
$sql_conditions = '', |
|
|
|
$sql_condition_parameters = [] |
|
) |
| |
|
staticprotected |
Helper method that creates the identical SQL query for the countUserRooms and findUserRooms methods.
◆ userHasRooms()
| static userHasRooms |
( |
User |
$user, |
|
|
|
$level = 'user', |
|
|
|
$permanent_only = false, |
|
|
|
$time = null, |
|
|
|
$sql_conditions = '', |
|
|
|
$sql_condition_parameters = [] |
|
) |
| |
|
static |
Checks whether the specified user has at least one permanent or temporary permission on at least one room. Root users and global resource admins always have permanent permissions.
- Parameters
-
| User | $user | The user whose permissions shall be checkec. |
| string | $level | The minimum permission level the user must have on a room so that it will be accepted for the check. Defaults to the "user" permission level. |
| bool | $permanent_only | Whether to count only rooms with permanent permissions (true) or rooms with permanent and temporary permissions (false). Defaults to false. |
| string | $sql_conditions | An optional SQL condition that will be placed in the WHERE block of the SQL query to filter the result set. |
| array | $sql_condition_parameters | An optional associative array for the sql condition parameter containing variable parameters that shall be used in the SQL query. |
| DateTime | int | null | $time | The timestamp for the check on temporary permissions. If this parameter is not set the current timestamp will be used. |
- Returns
- bool True, when the user has permissions for at least one room, false otherwise.
The documentation for this class was generated from the following file: