Stud.IP
6.0
|
Static Public Member Functions | |
static | exportUserdata (StoredUserData $storage) |
static | findAll () |
static | findOpen () |
static | findByResourceAndTimeRanges (Resource $resource, $time_ranges=[], $closed_status=null, $excluded_request_ids=[], $additional_conditions='', $additional_parameters=[]) |
static | countByResourceAndTimeRanges (Resource $resource, $time_ranges=[], $closed_status=null, $excluded_request_ids=[], $additional_conditions='', $additional_parameters=[]) |
static | findByCourse ($course_id) |
static | findByDate ($date_id) |
static | findByMetadate ($metadate_id) |
static | existsByCourse ($course_id, $request_is_open=false) |
static | existsByDate ($date_id, $request_is_open=false) |
static | existsByMetadate ($metadate_id, $request_is_open=false) |
Static Public Member Functions inherited from SimpleORMap | |
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 Public Member Functions inherited from PrivacyObject | |
static | exportUserData (StoredUserData $storage) |
Data Fields | |
const | MARK_NONE = 0 |
const | MARK_RED = 1 |
const | MARK_YELLOW = 2 |
const | MARK_GREEN = 3 |
const | REPLY_REQUESTER = 'requester' |
const | REPLY_LECTURER = 'lecturer' |
const | STATE_OPEN = 0 |
const | STATE_PENDING = 1 |
const | STATE_CLOSED = 2 |
const | STATE_DECLINED = 3 |
const | MARKING_STATES = 4 |
Data Fields inherited from SimpleORMap | |
const | ID_SEPARATOR = '_' |
Protected Member Functions | |
convertToEventData (array $time_intervals, User $user) | |
Protected Member Functions inherited from SimpleORMap | |
_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) | |
Static Protected Member Functions | |
static | configure ($config=[]) |
static | buildResourceAndTimeRangesSqlQuery (Resource $resource, $time_ranges=[], $closed_status=null, $excluded_request_ids=[], $additional_conditions='', $additional_parameters=[]) |
Static Protected Member Functions inherited from SimpleORMap | |
static | db_table () |
static | db_fields () |
static | pk () |
static | default_values () |
static | serialized_fields () |
static | alias_fields () |
static | i18n_fields () |
static | additional_fields () |
static | has_many () |
static | has_one () |
static | belongs_to () |
static | has_and_belongs_to_many () |
static | registered_callbacks () |
static | known_slots () |
static | notification_map () |
static | getter_setter_map () |
static | configure ($config=[]) |
static | config ($key) |
static | registerCallback ($types, $cb) |
static | unregisterCallback ($types, $cb) |
Additional Inherited Members | |
Static Public Attributes inherited from SimpleORMap | |
static | $schemes = null |
Protected Attributes inherited from SimpleORMap | |
$content = [] | |
$content_db = [] | |
$is_new = true | |
$is_deleted = false | |
$relations = [] | |
$additional_data = [] | |
Static Protected Attributes inherited from SimpleORMap | |
static | $config = [] |
static | $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id'] |
static | $performs_batch_operation = false |
|
staticprotected |
Internal method that generated the SQL query used in findByResourceAndTimeRanges and countByResourceAndTimeRanges.
cbAfterDelete | ( | ) |
cbAfterStore | ( | ) |
A callback method that send a mail when a new request has been udpated.
cbBeforeStore | ( | ) |
A callback method that sets the users connection before store.
cbLogNewRequest | ( | ) |
A callback method that creates a Stud.IP log entry when a new request has been made.
closeRequest | ( | $notify_lecturers = false , |
|
$bookings = [] |
|||
) |
Closes the requests and sends out notification mails. If the request is closed and a resource has been booked, it can be passed as parameter to be included in the notification mails.
bool | $notify_lecturers | Whether to notify lecturers of a course (true) or not (false). Defaults to false. Note that this parameter is only useful in case the request is bound to a course, either directly or via a course date or a course cycle date. |
ResourceBooking | $bookings | The resource bookings that have been created from this request. |
|
staticprotected |
|
protected |
|
static |
countOverlappingBookings | ( | ) |
Counts the resource bookings whose time ranges overlap with those of this resource request.
countOverlappingRequests | ( | ) |
Counts the resource requests whose time ranges overlap with those of this resource request.
deletePropertyIfExists | ( | $name = '' | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
Retrieves all resource requests from the database.
|
static |
|
static |
|
static |
|
static |
Retrieves all resource requests for the given resource and time range. By default, all requests are returned. To get only open or closed requests set the $closed_status parameter.
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 ], ... ] |
mixed | $closed_status | An optional status for the closed column in the database. By default this is set to null which means that resource requests are not filtered by the status column field. A value of 0 means only open requests are retrived. A value of 1 means only closed requests are retrieved. |
array | $excluded_request_ids | An array of strings representing resource request IDs. IDs specified in this array are excluded from the search. |
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:
|
|
static |
Retrieves all open resource requests from the database.
getAffectedDates | ( | ) |
Returns an array of date objects which are affected by this ResourceRequest.
getAllEventData | ( | ) |
Returns all event data this event source can provide.
Implements EventSource.
getAvailableProperties | ( | $excluded_property_names = [] | ) |
array | $excluded_property_names | Returns all resource property definitions for all properties which can be applied for this ResourceRequest by looking at the Resource category. If no resource category ID is set for the request an empty array is returned. |
Returns a textual representation of the dates for which the request has been created.
bool | $as_array | True, if an array with a string for each date (single or cycle date) shall be returned, false otherwise. |
getDerivedClassInstance | ( | ) |
getEndDate | ( | ) |
getEndSemester | ( | ) |
getEventDataForTimeRange | ( | DateTime | $begin, |
DateTime | $end | ||
) |
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.
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. |
Implements EventSource.
Retrieves the time intervals by looking at metadate objects and other time interval sources and returns them grouped by metadate.
bool | $with_preparation_time |
getLoggingInfoText | ( | ) |
getOverlappingBookings | ( | ) |
Returns the resource bookings whose time ranges overlap with those of this resource request.
getOverlappingRequests | ( | ) |
Returns the resource requests whose time ranges overlap with those of this resource request.
getPriority | ( | ) |
getProperty | ( | $name | ) |
$name | Returns the state of the property specified by $name. |
getPropertyData | ( | $excluded_property_names = [] | ) |
Returns a "compressed" array of resource request properties.
array | $excluded_property_names |
getPropertyObject | ( | $name | ) |
$name |
InvalidResourceCategoryException | If this resource category doesn't match the category of the resource request object. |
ResourcePropertyException | If the name of the resource request property is not defined for this resource category. |
getRangeId | ( | ) |
getRangeName | ( | ) |
getRangeObject | ( | ) |
getRangeType | ( | ) |
getRepetitionEndDate | ( | ) |
getRepetitionInterval | ( | ) |
Returns the repetion interval if regular appointments are used for this request.
getStartDate | ( | ) |
getStartSemester | ( | ) |
getStatus | ( | ) |
Returns a string representation of the status of the ResourceRequest.
getStatusText | ( | ) |
Returns a textual representation of the status of the ResourceRequest.
getTimeIntervals | ( | $with_preparation_time = false , |
|
$with_range = false , |
|||
$with_past_intervals = true |
|||
) |
Retrieves the time intervals for this request.
bool | $with_preparation_time | Whether the preparation time of the request shall be prepended to the begin timestamp (true) or whether it should not be included at all (false). Defaults to false. |
bool | $with_range | Whether to include data of the Stud.IP range and its corresponding ID to the request (true) or not (false). Defaults to false. |
bool | $with_past_intervals | Whether to include past intervals (true) or only include intervals from the current time and the future (false). Defaults to true. |
getTimeIntervalsInTimeRange | ( | DateTime | $begin, |
DateTime | $end | ||
) |
Filters the time intervals for this request by a specified time range.
getTimeIntervalStrings | ( | ) |
Returns a string representation of the time intervals for this request.
getType | ( | ) |
Returns a string representation of the ResourceRequest's type.
getTypeString | ( | $short = false | ) |
Returns a human-readable string describing the type of the request.
bool | $short | If this parameter is set to true, only the type of the request is returned without any information about the appointments. Otherwise, appointment information like the date or the repetition are appended. Defaults to false. |
isReadOnlyForUser | ( | User | $user | ) |
isSimpleRequest | ( | ) |
propertyExists | ( | $name | ) |
$name |
sendCloseRequestMailToLecturers | ( | $bookings = [] | ) |
array | $bookings | This method sends mails to the lecurers of the course (if any) where this request has been assigned to. The sent mail informs them about the closing of the request. |
sendCloseRequestMailToRequester | ( | $bookings = [] | ) |
array | $bookings | This method sends a mail to inform the requester that the request has been closed. |
sendNewRequestMail | ( | ) |
This method sends a notification mail to all room administrators that informs them of this new request.
sendRequestDeniedMail | ( | ) |
This method sends a mail to inform the requester about the denial of the request.
setProperty | ( | $name, | |
$state = '' |
|||
) |
string | $name | |
string | $state |
setRangeFields | ( | $range_type = '' , |
|
$range_ids = [] |
|||
) |
Sets the range fields (termin_id, metadate_id, course_id) or the ResourceRequestAppointment objects related to this request according to the range type and its range-IDs specified as parameters for this method. The ResourceRequest object is not stored after setting the fields / related objects.
string | $range_type | The range type for this request. One of the following: 'date', 'cycle', 'course' or 'date-multiple'. |
array | $range_ids | An array of range-IDs to be set for the specified range type. This is mostly an array of size one since the fields termin_id, metadate_id and course_id only accept one ID. The range type 'date-multiple' accepts multiple IDs. |
updateProperties | ( | $property_list = [] , |
|
$accept_null_values = false |
|||
) |
Sets or unsets the properties for this resource request.
array | $property_list | The properties which shall be set or unset. The array has the following structure: [ property_name => property_value ] |
bool | $accept_null_values | True, if a value of null shall be used when setting the property. If $accept_null_values is set to false all properties with a value equal to null will be deleted. |
validate | ( | ) |
This validation method is called before storing an object.
const MARK_GREEN = 3 |
const MARK_NONE = 0 |
const MARK_RED = 1 |
const MARK_YELLOW = 2 |
const MARKING_STATES = 4 |
The amount of defined marking states.
const REPLY_LECTURER = 'lecturer' |
const REPLY_REQUESTER = 'requester' |
const STATE_CLOSED = 2 |
const STATE_DECLINED = 3 |
const STATE_OPEN = 0 |
const STATE_PENDING = 1 |