|
| createStoreLogEntry () |
|
| createDeleteLogEntry () |
|
| store ($force_booking=false) |
|
| validate () |
|
| updateIntervals ($keep_exceptions=true) |
|
| deleteIfNoInterval () |
|
| deleteOverlappingBookings () |
|
| deleteOverlappingReservations () |
|
| endsWithSemester () |
|
| userIsOwner (User $user) |
|
| isReadOnlyForUser (User $user) |
|
| isRepetitionInTimeframe (DateTime $begin, DateTime $end) |
|
| getRepetitionInterval () |
|
| getRepeatModeString () |
|
| hasOverlappingBookings () |
|
| getOverlappingBookings () |
|
| calculateTimeIntervals ($as_datetime=false) |
|
| getTimeIntervals ($with_exceptions=true) |
|
| getTimeIntervalsInTimeRange (DateTime $begin, DateTime $end) |
|
| getAssignedUsers ($only_names=true) |
|
| getAssignedUser () |
|
| getAssignedUserType () |
|
| getAssignedUserName () |
|
| isSimpleBooking () |
|
| hasExceptions () |
|
| __toString () |
|
| getTimeIntervalStrings () |
|
| convertToEventData (array $time_intervals, $user) |
|
| getAllEventData () |
|
| getEventDataForTimeRange (DateTime $begin, DateTime $end) |
|
| getFilteredEventData ( $user_id=null, $range_id=null, $range_type=null, $begin=null, $end=null) |
|
| getRepetitionType () |
|
| sendDeleteNotification () |
|
| __construct ($id=null) |
|
| __clone () |
|
| getRelationOptions ($relation) |
|
| getTableMetadata () |
|
| hasAutoIncrementColumn () |
|
| setId ($id) |
|
| getId () |
|
| getNewId () |
|
| toArray ($only_these_fields=null) |
|
| toRawArray ($only_these_fields=null) |
|
| toArrayRecursive ($only_these_fields=null) |
|
| getValue ($field) |
|
| getRelationValue ($relation, $field) |
|
| getDefaultValue ($field) |
|
| setValue ($field, $value) |
|
| __get ($field) |
|
| __set ($field, $value) |
|
| __isset ($field) |
|
| offsetExists ($offset) |
|
| offsetGet ($offset) |
|
| offsetSet ($offset, $value) |
|
| offsetUnset ($offset) |
|
| getIterator () |
|
| count () |
|
| isField ($field) |
|
| isRelation ($field) |
|
| isAdditionalField ($field) |
|
| isAliasField ($field) |
|
| isI18nField ($field) |
|
| setData ($data, $reset=false) |
|
| isNew () |
|
| isDeleted () |
|
| setNew ($is_new) |
|
| getWhereQuery () |
|
| restore () |
|
| store () |
|
| triggerChdate () |
|
| delete () |
|
| isDirty () |
|
| isFieldDirty ($field) |
|
| revertValue ($field) |
|
| getPristineValue ($field) |
|
| initRelation ($relation) |
|
| resetRelation ($relation) |
|
| cleanup () |
|
| getEventDataForTimeRange (\DateTime $begin, \DateTime $end) |
|
|
static | findByResourceAndTimeRanges (Resource $resource, $time_ranges=[], $booking_types=[], $excluded_booking_ids=[]) |
|
static | countByResourceAndTimeRanges (Resource $resource, $time_ranges=[], $booking_types=[], $excluded_booking_ids=[]) |
|
static | deleteByResourceAndTimeRanges (Resource $resource, $time_ranges=[], $booking_types=[], $excluded_booking_ids=[]) |
|
static | exportUserData (StoredUserData $storage) |
|
static | tableScheme ($db_table) |
|
static | expireTableScheme () |
|
static | exists ($id) |
|
static | countBySql ($sql='1', $params=[]) |
|
static | create ($data) |
|
static | build ($data, $is_new=true) |
|
static | buildExisting ($data) |
|
static | import ($data) |
|
static | findBySQL ($sql, $params=[]) |
|
static | findOneBySQL ($where, $params=[]) |
|
static | findThru ($foreign_key_value, $options) |
|
static | findEachBySQL ($callable, $sql, $params=[]) |
|
static | findMany ($pks=[], $order='', $order_params=[]) |
|
static | findEachMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | findAndMapBySQL ($callable, $where, $params=[]) |
|
static | findAndMapMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | deleteBySQL ($where, $params=[]) |
|
static | toObject ($id_or_object) |
|
static | __callStatic (string $name, array $arguments) |
|
|
static | $schemes = null |
|
| _getId ($field) |
|
| _setId ($field, $value) |
|
| _getAdditionalValueFromRelation ($field) |
|
| _setAdditionalValueFromRelation ($field, $value) |
|
| _getAdditionalValue ($field) |
|
| _setAdditionalValue ($field, $value) |
|
| parseRelationOptions ($type, $name, $options) |
|
| storeRelations ($only_these=null) |
|
| deleteRelations () |
|
| initializeContent () |
|
| applyCallbacks ($type) |
|
| cbNotificationMapper ($cb_type) |
|
| cbAfterInitialize ($cb_type) |
|
| setSerializedValue ($field, $value) |
|
| setI18nValue ($field, $value) |
|
| $content = [] |
|
| $content_db = [] |
|
| $is_new = true |
|
| $is_deleted = false |
|
| $relations = [] |
|
| $additional_data = [] |
|
string | $i18n_class = I18NString::class |
|
static | $config = [] |
|
static | $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id'] |
|
static | $performs_batch_operation = false |
|
◆ __toString()
◆ buildResourceAndTimeRangesSqlQuery()
static buildResourceAndTimeRangesSqlQuery |
( |
Resource |
$resource, |
|
|
|
$time_ranges = [] , |
|
|
|
$booking_types = [] , |
|
|
|
$excluded_booking_ids = [] |
|
) |
| |
|
staticprotected |
Internal method that generated the SQL query used in findByResourceAndTimeRanges and countByResourceAndTimeRanges.
- See also
- findByResourceAndTimeRanges
◆ calculateTimeIntervals()
calculateTimeIntervals |
( |
|
$as_datetime = false | ) |
|
Calculates all time intervals as begin and end timestamps by looking at the repetition settings, if any.
- Parameters
-
bool | $as_datetime | Whether to return the timestamps as DateTime objects (true) or not (false). Defaults to false. |
- Returns
- array A two-dimensional array with each time interval for this booking. The array has the following structure: [ [ 'begin' => Begin timestamp. 'end' => End timestamp. ] ]
◆ configure()
static configure |
( |
|
$config = [] | ) |
|
|
staticprotected |
◆ convertToEventData()
convertToEventData |
( |
array |
$time_intervals, |
|
|
|
$user |
|
) |
| |
◆ countByResourceAndTimeRanges()
static countByResourceAndTimeRanges |
( |
Resource |
$resource, |
|
|
|
$time_ranges = [] , |
|
|
|
$booking_types = [] , |
|
|
|
$excluded_booking_ids = [] |
|
) |
| |
|
static |
Counts all resource bookings for the specified resource and time range. By default, all bookings are counted. To count only bookings of a certain type set the $booking_type parameter.
- See also
- findByResourceAndTimeRanges
◆ createDeleteLogEntry()
◆ createStoreLogEntry()
◆ deleteByResourceAndTimeRanges()
static deleteByResourceAndTimeRanges |
( |
Resource |
$resource, |
|
|
|
$time_ranges = [] , |
|
|
|
$booking_types = [] , |
|
|
|
$excluded_booking_ids = [] |
|
) |
| |
|
static |
Deletes all resource bookings for the specified resource and time range. By default, all bookings are counted. To count only bookings of a certain type set the $booking_type parameter.
- See also
- findByResourceAndTimeRanges
◆ deleteIfNoInterval()
◆ deleteOverlappingBookings()
deleteOverlappingBookings |
( |
| ) |
|
Deletes all bookings in the time ranges of this resource booking. Such bookings would prevent saving this booking.
- Returns
- int The amount of deleted bookings.
◆ deleteOverlappingReservations()
deleteOverlappingReservations |
( |
| ) |
|
Deletes all reservations in the time ranges of this resource booking.
- Returns
- int The amount of deleted reservations.
◆ endsWithSemester()
Determines whether the resource booking ends on the same timestamp like the lecture time of one of the defined semesters.
- Returns
- True, if the resource booking ends with a semester, false otherwise.
◆ exportUserData()
◆ findByResourceAndTimeRanges()
static findByResourceAndTimeRanges |
( |
Resource |
$resource, |
|
|
|
$time_ranges = [] , |
|
|
|
$booking_types = [] , |
|
|
|
$excluded_booking_ids = [] |
|
) |
| |
|
static |
Retrieves all resource booking for the given resource and time range. By default, all booking are returned. To get only bookings of a certain type set the $booking_type parameter.
- Parameters
-
Resource | $resource | The resource whose requests shall be retrieved. |
array | $time_ranges | An array with time ranges as DateTime objects. The array has the following structure: [ [ 'begin' => begin timestamp, 'end' => end timestamp ], ... ] |
array | $booking_types | An optional specification for the booking_type column in the database. More than one booking type can be specified. By default this is set to an empty array which means that resource booking are not filtered by the type column. The allowed resource booking types are specified in the class documentation. |
array | $excluded_booking_ids | An array of strings representing resource booking IDs. IDs specified in this array are excluded from the search. |
- Returns
- ResourceBooking[] An array of ResourceRequest objects. If no requests can be found, the array is empty.
- Exceptions
-
InvalidArgumentException,if | the time ranges are either not in an array matching the format description from above or if one of the following conditions is met in one of the time ranges:
|
◆ getAllEventData()
Returns all event data this event source can provide.
- Returns
- EventData[] An array of Studip objects.
Implements EventSource.
◆ getAssignedUser()
◆ getAssignedUserName()
◆ getAssignedUsers()
getAssignedUsers |
( |
|
$only_names = true | ) |
|
Returns all allocating users: Users who are associated with this booking through a request or a course date for which this booking has been made (all allocating users). If no user could be determined but the booking is bound to a course, the course name is returned instead.
- Parameters
-
bool | $only_names | Whether only the names of these users shall be returned (true) or user objects shall be returned (false). |
- Returns
- string[]|User[] Depending on the value of the $only_names parameter a string array or an user object array is returned. In case no user can be found, the array is empty. In case the parameter $only_names is set to true, the result may also contain a course name, if no users can be found but the booking is bound to a course.
◆ getAssignedUserType()
◆ getEventDataForTimeRange()
getEventDataForTimeRange |
( |
DateTime |
$begin, |
|
|
DateTime |
$end |
|
) |
| |
◆ getFilteredEventData()
getFilteredEventData |
( |
|
$user_id = null , |
|
|
|
$range_id = null , |
|
|
|
$range_type = null , |
|
|
|
$begin = null , |
|
|
|
$end = null |
|
) |
| |
Allows a filtered output of event data based on a specified user, a specified range-ID and range type (must be supported by the Context class) or a specified time range. If no filters are applied the result should be the same as if the getAllEventData method from this interface is called.
- Parameters
-
string | $user_id | The user for whom the event data shall be retrieved. Depending on the implementation, this parameter might be necessary to check permissions for event objects. |
string | $range_id | An optional range-ID that may be necessary for an implementation to check for permissions. |
string | $range_type | An optional range type that may be necessary for an implementation to check for permissions. |
DateTime | int | string | $begin | The begin date as DateTime object or unix timestamp. |
DateTime | int | string | $end | The end date as DateTime object or unix timestamp. |
- Returns
- EventData[] An array of Studip objects.
Implements EventSource.
◆ getOverlappingBookings()
getOverlappingBookings |
( |
| ) |
|
Gets the bookings that overlap with this booking.
- Returns
- array Array of ResourceBooking objects
◆ getRepeatModeString()
◆ getRepetitionInterval()
getRepetitionInterval |
( |
| ) |
|
Returns the DateInterval object according to the set repetition interval of this resource booking object.
- Returns
- DateInterval|null A DateInterval object or null, if this booking has no repetition interval.
◆ getRepetitionType()
◆ getTimeIntervals()
getTimeIntervals |
( |
|
$with_exceptions = true | ) |
|
◆ getTimeIntervalsInTimeRange()
getTimeIntervalsInTimeRange |
( |
DateTime |
$begin, |
|
|
DateTime |
$end |
|
) |
| |
Retrieves all time intervals for this resource booking in a specified time range.
- Parameters
-
DateTime | $begin | The begin of the time range. |
DateTime | $end | The end of the time range. |
- Returns
- ResourceBookingInterval[] An array of ResourceBookingInterval objects.
◆ getTimeIntervalStrings()
getTimeIntervalStrings |
( |
| ) |
|
◆ hasExceptions()
Determins whether the booking has exceptions in repetitions or not. When the booking is bound to a course via a CourseDate instance, the exceptions are looked up using the corresponding metadate (if any). If a metadate exists to the course date and it has cancelled dates (metadate has CourseExDate instances assigned) then the booking has exceptions. If the booking is a simple booking, the exception status is determined by checking if the booking has ResourceBookingInterval instances that don't take place assigned to it. This is only checked, if a repetition interval is set for the booking so that such instances can exist.
- Returns
- bool True, if the booking has exceptions in the repetition, false otherwise.
◆ hasOverlappingBookings()
hasOverlappingBookings |
( |
| ) |
|
Determines if the resource booking overlaps with another resource booking.
- Returns
- bool True, if there are other bookings which overlap with this one, false otherwise.
◆ isReadOnlyForUser()
isReadOnlyForUser |
( |
User |
$user | ) |
|
Determines wheter the booking is read only for a specified user.
- Parameters
-
User | $user | The user whose permissions shall be checked. |
- Returns
- bool True, if the specified user may only perform reading actions on the booking, false otherwise.
◆ isRepetitionInTimeframe()
isRepetitionInTimeframe |
( |
DateTime |
$begin, |
|
|
DateTime |
$end |
|
) |
| |
Determines whether this resource booking has a repetition in the specified time range.
- Parameters
-
DateTime | $begin | |
DateTime | $end | |
- Returns
- bool True, if the booking has repetitions in the timeframe specified by $begin and $end, false otherwise.
◆ isSimpleBooking()
Determines whether the booking is a simple booking that is not bound to course dates or similar Stud.IP objects.
◆ sendDeleteNotification()
sendDeleteNotification |
( |
| ) |
|
Sends a notification that the booking has been deleted to the user that created the booking.
◆ store()
store |
( |
|
$force_booking = false | ) |
|
The SimpleORMap::store method is overloaded to allow forced booking of resource bookings, meaning that all other bookings of the resource of a booking are deleted when they overlap with this booking.
- Parameters
-
bool | $force_booking | Whether booking shall be forced (true) or not (false). Defaults to false. |
- Returns
- bool
◆ updateIntervals()
updateIntervals |
( |
|
$keep_exceptions = true | ) |
|
This method updates the intervals of this resource booking which are stored in the resource_booking_intervals table.
◆ userIsOwner()
userIsOwner |
( |
User |
$user | ) |
|
Check if the specified user is the owner of the booking.
- Parameters
-
User | $user | The user whose ownership shall be tested. |
- Returns
- bool True, if the specified user is the owner of the booking, false otherwise.
◆ validate()
This validation method is called before storing an object.
◆ TYPE_LOCK
◆ TYPE_NORMAL
◆ TYPE_PLANNED
◆ TYPE_RESERVATION
const TYPE_RESERVATION = 1 |
The documentation for this class was generated from the following file: