|
Stud.IP
jlu_4.3 Revision 64286
|


Public Member Functions | |
| __toString () | |
| cbValidate () | |
| getFullName () | |
| getDefaultPictureUrl () | |
| getIcon ($role='info') | |
| checkHierarchy () | |
| getLink ($action='show', $link_parameters=[]) | |
| getURL ($action='show', $url_parameters=[]) | |
| findBuildings () | |
| addChild (Resource $resource) | |
| createSimpleBooking (User $user, DateTime $begin, DateTime $end, $preparation_time=0, $description='', $internal_comment='', $booking_type=0) | |
| createBookingFromRequest (User $user, ResourceRequest $request, $preparation_time=0, $description='', $internal_comment='', $booking_type=0, $prepend_preparation_time=false, $notify_lecturers=false) | |
| createBooking (User $user, $range_id=null, $time_ranges=[], $repetition_interval=null, $repetition_amount=0, $repetition_end_date=null, $preparation_time=0, $description='', $internal_comment='', $booking_type=0, $force_booking=false) | |
| createSimpleRequest (User $user, DateTime $begin, DateTime $end, $comment='', $preparation_time=0) | |
| createRequest (User $user, $date_range_ids=null, $comment='', $properties=[], $preparation_time=0) | |
| createLock (User $user, DateTime $begin, DateTime $end, $internal_comment='') | |
| isAssigned (DateTime $begin, DateTime $end, $excluded_booking_ids=[]) | |
| isReserved (DateTime $begin, DateTime $end, $excluded_reservation_ids=[]) | |
| isLocked (DateTime $begin, DateTime $end, $excluded_lock_ids=[]) | |
| isAvailable (DateTime $begin, DateTime $end, $excluded_booking_ids=[]) | |
Public Member Functions inherited from Resource | |
| store () | |
| delete () | |
| cbValidate () | |
| __toString () | |
| getFolder () | |
| setFolder (ResourceFolder $folder) | |
| createFolder () | |
| createSimpleBooking (User $user, DateTime $begin, DateTime $end, $preparation_time=0, $description='', $internal_comment='', $booking_type=0) | |
| createBookingFromRequest (User $user, ResourceRequest $request, $preparation_time=0, $description='', $internal_comment='', $booking_type=0, $prepend_preparation_time=false, $notify_lecturers=false) | |
| createBooking (User $user, $range_id=null, $time_ranges=[], $repetition_interval=null, $repetition_amount=0, $repetition_end_date=null, $preparation_time=0, $description='', $internal_comment='', $booking_type=0, $force_booking=false) | |
| createSimpleRequest (User $user, DateTime $begin, DateTime $end, $comment='', $preparation_time=0) | |
| createRequest (User $user, $date_range_ids=null, $comment='', $properties=[], $preparation_time=0) | |
| createLock (User $user, DateTime $begin, DateTime $end, $internal_comment='') | |
| getGroupedProperties ($excluded_properties=[]) | |
| propertyExists ($name='') | |
| getPropertyObject ($name='') | |
| getProperty ($name='') | |
| getPropertyRelatedObject ($name='') | |
| setProperty ($name='', $state='', $user=null) | |
| setPropertiesByName ($properties=[], $user) | |
| setPropertiesById ($properties=[], $user=null) | |
| isPropertyEditable ($name='', User $user) | |
| setPropertyByDefinitionId ( $property_definition_id=null, $state=null) | |
| setPropertyRelatedObject ($name='', $object=null) | |
| deleteProperty ($name='', User $user) | |
| getPictureUrl () | |
| getDefaultPictureUrl () | |
| getIcon ($role='info') | |
| getPropertyArray ($only_requestable_properties=false) | |
| isAssigned (DateTime $begin, DateTime $end, $excluded_booking_ids=[]) | |
| isReserved (DateTime $begin, DateTime $end, $excluded_reservation_ids=[]) | |
| isLocked (DateTime $begin, DateTime $end, $excluded_lock_ids=[]) | |
| isAvailable (DateTime $begin, DateTime $end, $excluded_booking_ids=[]) | |
| isAvailableForRequest (ResourceRequest $request) | |
| getFullName () | |
| setUserPermission (User $user, $perm='autor') | |
| deleteUserPermission (User $user) | |
| deleteAllPermissions () | |
| getUserPermission (User $user, $time_range=[], $permanent_only=false) | |
| userHasPermission (User $user, $permission='user', $time_range=[], $permanent_only=false) | |
| userMayCreateChild (User $user) | |
| userHasBookingRights (User $user, $begin=null, $end=null) | |
| bookingPlanVisibleForUser (User $user, $time_range=[]) | |
| findParentByClassName ($class_name='Resource') | |
| findChildrenByClassName ( $class_name='Resource', $depth=0, $convert_objects=true, $order_by_name=true) | |
| addChild (Resource $resource) | |
| getOpenResourceRequests (DateTime $begin, DateTime $end) | |
| getResourceBookings (DateTime $begin, DateTime $end) | |
| getResourceLocks (DateTime $begin, DateTime $end) | |
| hasFiles () | |
| getDerivedClassInstance () | |
| checkHierarchy () | |
| getHierarchyPath ($separator='/', $prepend_root=true) | |
| getLink ($action='show', $link_parameters=[]) | |
| getURL ($action='show', $url_parameters=[]) | |
| getItemName ($long_format=true) | |
| getItemURL () | |
| getItemAvatarURL () | |
Public Member Functions inherited from SimpleORMap | |
| __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) | |
| 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 () | |
| getItemName ($long_format=true) | |
| getItemURL () | |
| getItemAvatarURL () | |
Static Public Member Functions | |
| static | getTranslatedClassName ($item_count=1) |
| static | findAll () |
| static | getLinkForAction ( $action='show', $id=null, $link_parameters=[]) |
| static | getURLForAction ( $action='show', $id=null, $url_parameters=[]) |
Static Public Member Functions inherited from Resource | |
| static | getTranslatedClassName ($item_count=1) |
| static | getRootResources () |
| static | getRequiredProperties () |
| static | getLinkForAction ( $action='show', $id=null, $link_parameters=[]) |
| static | getURLForAction ( $action='show', $id=null, $url_parameters=[]) |
Static Public Member Functions inherited from SimpleORMap | |
| static | tableScheme ($db_table) |
| static | expireTableScheme () |
| static | find ($id) |
| static | exists ($id) |
| static | countBySql ($sql=1, $params=array()) |
| static | create ($data) |
| static | build ($data, $is_new=true) |
| static | buildExisting ($data) |
| static | import ($data) |
| static | findBySQL ($sql, $params=array()) |
| static | findOneBySQL ($where, $params=array()) |
| static | findThru ($foreign_key_value, $options) |
| static | findEachBySQL ($callable, $sql, $params=array()) |
| static | findMany ($pks=array(), $order='', $order_params=array()) |
| static | findEachMany ($callable, $pks=array(), $order='', $order_params=array()) |
| static | findAndMapBySQL ($callable, $where, $params=array()) |
| static | findAndMapMany ($callable, $pks=array(), $order='', $order_params=array()) |
| static | deleteBySQL ($where, $params=array()) |
| static | toObject ($id_or_object) |
| static | __callStatic ($name, $arguments) |
Static Protected Member Functions | |
| static | configure ($config=[]) |
| static | buildPathForAction ($action='show', $id=null) |
| static | configure ($config=[]) |
| static | buildPathForAction ($action='show', $id=null) |
Static Protected Member Functions inherited from SimpleORMap | |
| static | configure ($config=array()) |
| static | config ($key) |
Additional Inherited Members | |
Data Fields inherited from SimpleORMap | |
| const | ID_SEPARATOR = '_' |
Static Public Attributes inherited from SimpleORMap | |
| static | $schemes = null |
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) | |
| registerCallback ($types, $cb) | |
| unregisterCallback ($types, $cb) | |
| cbAutoIncrementColumn ($type) | |
| cbAutoKeyCreation () | |
| cbNotificationMapper ($cb_type) | |
| cbAfterInitialize ($cb_type) | |
| setSerializedValue ($field, $value) | |
| setI18nValue ($field, $value) | |
| cbI18N ($type) | |
Protected Attributes inherited from SimpleORMap | |
| $content = array() | |
| $content_db = array() | |
| $is_new = true | |
| $is_deleted = false | |
| $db_table = '' | |
| $db_fields = null | |
| $pk = null | |
| $default_values = array() | |
| $serialized_fields = array() | |
| $alias_fields = array() | |
| $i18n_fields = array() | |
| $additional_fields = array() | |
| $relations = array() | |
| $has_many = array() | |
| $has_one = array() | |
| $belongs_to = array() | |
| $has_and_belongs_to_many = array() | |
| $registered_callbacks = array() | |
| $known_slots = array() | |
| $notification_map = array() | |
| $additional_data = array() | |
| $getter_setter_map = array() | |
Static Protected Attributes inherited from Resource | |
| static | $permission_cache |
Static Protected Attributes inherited from SimpleORMap | |
| static | $config = array() |
| static | $reserved_slots = array('value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id') |
| __toString | ( | ) |
| addChild | ( | Resource | $resource | ) |
Adds a child resource to this location. The child resource must not be a resource of the Location class.
| Resource | $resource | The resource which shall be added as child. |
| InvalidResourceException | If the specified resource belongs to the Location resource class. |
Reimplemented from Resource.
|
staticprotected |
Returns the part of the URL for getLink and getURL which will be placed inside the calls to URLHelper::getLink and URLHelper::getURL in these methods.
Reimplemented from Resource.
| cbValidate | ( | ) |
Reimplemented from Resource.
| checkHierarchy | ( | ) |
Checks if the place in the resource hierarchy (resource tree) is correct for this resource. This method has no function in this class but can be filled with logic in one of the classes derived from Resource.
| NoResourceClassException | if the class name of this resource is not a derived class of the Resource class. |
Reimplemented from Resource.

|
staticprotected |
set configuration data from subclass
| array | $config | configuration data |
Reimplemented from Resource.
| createBooking | ( | User | $user, |
$range_id = null, |
|||
$time_ranges = [], |
|||
$repetition_interval = null, |
|||
$repetition_amount = 0, |
|||
$repetition_end_date = null, |
|||
$preparation_time = 0, |
|||
$description = '', |
|||
$internal_comment = '', |
|||
$booking_type = 0, |
|||
$force_booking = false |
|||
| ) |
A factory method for creating a ResourceBooking object for this resource.
| User | $user | The user who wishes to create a resource booking. |
| string | $range_id | The ID of the user (or the Stud.IP object) which owns the ResourceBooking. |
| Array[][] | $time_ranges | The time ranges for the booking. At least one time range has to be specified using unix timestamps or DateTime objects. This array has the following structure: [ [ 'begin' => The begin timestamp or DateTime object. 'end' => The end timestamp or DateTime object. ] ] |
| DateInterval | null | $repetition_interval | The repetition interval for the new booking. This must be a DateInterval object if repetitions shall be stored. Otherwise this parameter must be set to null. |
| int | $repeat_amount | The amount of repetitions. This parameter is only regarded if $repetition_interval contains a DateInterval object. In case repetitions are specified by their end date set this parameter to 0. |
| DateTime | string | null | $repetition_end_date | The end date of the repetition. This can either be an unix timestamp or a DateTime object and will only be regarded if $repetition_interval contains a DateInterval object. In case repetitions are specified by their amount set this parameter to null. |
| int | $preparation_time | The preparation time which is needed before the real start time. This will be substracted from the begin timestamp and stored in an extra column of the resource_bookings table. |
| string | $description | An optional description for the booking. This fields was previously known as "user_free_name". |
| string | $internal_comment | An optional comment for the booking which is intended to be used internally in the room and resource administration staff. |
| int | $booking_type | The booking type. 0 = normal booking 1 = reservation 2 = lock booking |
| bool | $force_booking | If this parameter is set to true, overlapping bookings are removed before storing this booking. |
| InvalidArgumentException | If no time ranges are specified or if there is an error regarding the time ranges. |
| ResourceBookingRangeException | If $range_id is not set. |
| ResourceBookingOverlapException | If the booking overlaps with another booking or a resource lock. |
| ResourcePermissionException | If the specified user does not have sufficient permissions to create a resource booking. |
| ResourceBookingException | If the repetition interval is invalid or if the resource booking cannot be stored. |
Reimplemented from Resource.
| createBookingFromRequest | ( | User | $user, |
| ResourceRequest | $request, | ||
$preparation_time = 0, |
|||
$description = '', |
|||
$internal_comment = '', |
|||
$booking_type = 0, |
|||
$prepend_preparation_time = false, |
|||
$notify_lecturers = false |
|||
| ) |
Creates bookings from a request.
| ResourceRequest | $request | The request from which a resource booking shall be built. |
| bool | $prepend_preparation_time,. | If this is set to true, the preparation time will end before the start of the requested time. If $prepend_preparation_time is set to false (the default) the preparation time starts with the start of the requested time. |
| ResourceUnavailableException | if the resource cannot be assigned in at least one of the time ranges specified by the resource request. |
| ResourceRequestException | if the request could not be marked as resolved. |
Reimplemented from Resource.
| createLock | ( | User | $user, |
| DateTime | $begin, | ||
| DateTime | $end, | ||
$internal_comment = '' |
|||
| ) |
Creates a lock booking for this resource.
| User | $user | The user who wishes to create a lock booking. |
| DateTime | $begin | The begin of the lock time range. |
| DateTime | $end | The end of the lock time range. |
| string | $internal_comment | An optional comment for the lock booking which is intended to be used internally in the room and resource administration staff. |
| AccessDeniedException | If the user does not have sufficient permissions to lock this resource. |
| ResourceUnavailableException | If a lock booking already exists in the specified time range. |
Reimplemented from Resource.
| createRequest | ( | User | $user, |
$date_range_ids = null, |
|||
$comment = '', |
|||
$properties = [], |
|||
$preparation_time = 0 |
|||
| ) |
This method creates a resource request for this resource.
| User | $user | The user who wishes to create a request. |
| string | Array | $date_range_ids | One or more IDs of Stud.IP objects which can provide at least one time range. Objects which fulfill this requirement are course dates (CourseDate objects), cycle dates (SeminarCycleDate objects) and courses (Course objects). If only one ID is provided it can be passed as string. If multiple IDs are provided they have to be passed as array. |
| string | $comment | A comment for the resource request. |
| mixed[] | $properties | The wishable properties for the resource request. The format of the array is as follows: [ 'property name' => 'property state' ] |
| int | $preparation_time | The requested preparation time before the begin of the requested time range. This parameter must be specified in seconds. Only positive values are accepted. |
| InvalidArgumentException | If $date_range_id is not set. or no object which can provide at least one time range can be found with the specified ID. |
| ResourceNoTimeRangeException | If no time range can be found by looking at the object, specified by its ID in $date_range_id. |
| ResourceUnavailableException | If the resource is not available in the selected time range. |
| ResourceRequestException | If the resource request cannot be stored. |
Reimplemented from Resource.
| createSimpleBooking | ( | User | $user, |
| DateTime | $begin, | ||
| DateTime | $end, | ||
$preparation_time = 0, |
|||
$description = '', |
|||
$internal_comment = '', |
|||
$booking_type = 0 |
|||
| ) |
This is a simplified version of the createBooking method.
Reimplemented from Resource.
| createSimpleRequest | ( | User | $user, |
| DateTime | $begin, | ||
| DateTime | $end, | ||
$comment = '', |
|||
$preparation_time = 0 |
|||
| ) |
This method creates a simple request for this resource. A simple request is not bound to a date, metadate or course object and its time ranges. Instead the time range is specified directly. Note that simple resource requests do not support recurrence.
| User | $user | The user who wishes to create a simple request. |
| DateTime | $begin | The begin timestamp of the request. |
| DateTime | $end | The end timestamp of the request. |
| string | $comment | A comment for the resource request. |
| int | $preparation_time | The requested preparation time before the begin of the requested time range. This parameter must be specified in seconds. Only positive values are accepted. |
| AccessDeniedException | If the user is not permitted to request this resource. |
| InvalidArgumentException | If the the timestamps provided by $begin and $end are invalid or if $begin is greater than or equal to $end which results in an invalid time range. |
| ResourceUnavailableException | If the resource is not available in the selected time range. |
| ResourceRequestException | If the resource request cannot be stored. |
Reimplemented from Resource.
|
static |
| findBuildings | ( | ) |
| getDefaultPictureUrl | ( | ) |
Returns the default picture for the resource class.
Classes derived from Resource should re-implement this method if they want to get a different default picture than the resource icon. The call to getPictureUrl will call the getDefaultPictureUrl method from the derived class.
Reimplemented from Resource.

| getFullName | ( | ) |
Returns the full (localised) name of the location.
Reimplemented from Resource.

| getIcon | ( | $role = 'info' | ) |
Returns the Icon for the resource class.
Classes derived from Resource should re-implement this method if they want to get a different icon than the resource icon.
Reimplemented from Resource.


| getLink | ( | $action = 'show', |
|
$link_parameters = [] |
|||
| ) |
Returns the link for an action for this building. This is the non-static variant of Building::getLinkForAction.
| string | $action | The action which shall be executed. For locations the actions 'show', 'add', 'edit' and 'delete' are defined. |
| array | $link_parameters | Optional parameters for the link. |
Reimplemented from Resource.

|
static |
Returns the appropriate link for the location action that shall be executed on a location.
| string | $action | The action which shall be executed. For locations the actions 'show', 'add', 'edit' and 'delete' are defined. |
| string | $id | The ID of the location on which the specified action shall be executed. |
| array | $link_parameters | Optional parameters for the link. |
Reimplemented from Resource.


|
static |
Returns a translation of the resource class name. The translated name can be singular or plural, depending on the value of the parameter $item_count.
| int | $item_count | The amount of items the translation shall be made for. This is only used to determine, if a singular or a plural form shall be returned. |
Reimplemented from Resource.
| getURL | ( | $action = 'show', |
|
$url_parameters = [] |
|||
| ) |
Returns the URL for an action for this location. This is the non-static variant of Location::getURLForAction.
| string | $action | The action which shall be executed. For locations the actions 'show', 'add', 'edit' and 'delete' are defined. |
| array | $url_parameters | Optional parameters for the URL. |
Reimplemented from Resource.

|
static |
Returns the appropriate URL for the location action that shall be executed on a location.
| string | $action | The action which shall be executed. For locations the actions 'show', 'add', 'edit' and 'delete' are defined. |
| string | $id | The ID of the location on which the specified action shall be executed. |
| array | $url_parameters | Optional parameters for the URL. |
Reimplemented from Resource.


| isAssigned | ( | DateTime | $begin, |
| DateTime | $end, | ||
$excluded_booking_ids = [] |
|||
| ) |
Shortcut method for ResourceBooking::countByResourceAndTimeRanges. Determines whether normal resource bookings exist in the specified time range.
| DateTime | $begin | Time range start timestamp. |
| DateTime | $end | Time range end timestamp. |
| $excluded_lock_ids | The IDs of bookings that shall be excluded from the determination of the "assigned" status. |
Reimplemented from Resource.
| isAvailable | ( | DateTime | $begin, |
| DateTime | $end, | ||
$excluded_booking_ids = [] |
|||
| ) |
Determines, if the resource is available (not assigned or locked) in a specified time range.
| DateTime | $begin | Time range start timestamp. |
| DateTime | $end | Time range end timestamp. |
| $excluded_booking_ids | The IDs of available bookings that shall be excluded from the determination of the "available" status. |
Reimplemented from Resource.
| isLocked | ( | DateTime | $begin, |
| DateTime | $end, | ||
$excluded_lock_ids = [] |
|||
| ) |
Shortcut method for ResourceBooking::countByResourceAndTimeRanges. Determines whether resource locks exist in the specified time range.
| DateTime | $begin | Time range start timestamp. |
| DateTime | $end | Time range end timestamp. |
| $excluded_lock_ids | The IDs of lock bookings that shall be excluded from the determination of the "locked" status. |
Reimplemented from Resource.
| isReserved | ( | DateTime | $begin, |
| DateTime | $end, | ||
$excluded_reservation_ids = [] |
|||
| ) |
Shortcut method for ResourceBooking::countByResourceAndTimeRanges. Determines whether resource reservations exist in the specified time range.
| DateTime | $begin | Time range start timestamp. |
| DateTime | $end | Time range end timestamp. |
| $excluded_lock_ids | The IDs of reservation bookings that shall be excluded from the determination of the "reserved" status. |
Reimplemented from Resource.