Stud.IP  jlu_4.3 Revision 64286
ResourceLabel Class Reference
Inheritance diagram for ResourceLabel:
Inheritance graph
Collaboration diagram for ResourceLabel:
Collaboration graph

Public Member Functions

 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='')
 
 propertyExists ($name='')
 
 getPropertyObject ($name='')
 
 getProperty ($name='')
 
 getPropertyRelatedObject ($name='')
 
 setProperty ($name='', $state='', $user_id=null)
 
 isPropertyEditable ($name='', User $user)
 
 setPropertyByDefinitionId ( $property_definition_id=null, $state=null)
 
 setPropertyRelatedObject ($name='', $object=null)
 
 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 ()
 
 getOpenResourceRequests (DateTime $begin, DateTime $end)
 
 getResourceBookings (DateTime $begin, DateTime $end)
 
 getResourceLocks (DateTime $begin, DateTime $end)
 
 hasFiles ()
 
 checkHierarchy ()
 
 getItemAvatarURL ()
 
- 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 ()
 

Additional Inherited Members

- 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)
 
- 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)
 
- Static Protected Member Functions inherited from Resource
static configure ($config=[])
 
static buildPathForAction ($action='show', $id=null)
 
- Static Protected Member Functions inherited from SimpleORMap
static configure ($config=array())
 
static config ($key)
 
- 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')
 

Detailed Description

The ResourceLabel class represents headings or subheadings whose only purpose is helping with organising the resource tree. ResourceLabel instances must not be booked, reserved or locked. Furthermore, they cannot be requested.

Member Function Documentation

◆ checkHierarchy()

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.

Exceptions
NoResourceClassExceptionif the class name of this resource is not a derived class of the Resource class.
Returns
bool True, if this resource is correctly placed, false otherwise.

Reimplemented from Resource.

◆ createBooking()

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.

Parameters
User$userThe user who wishes to create a resource booking.
string$range_idThe ID of the user (or the Stud.IP object) which owns the ResourceBooking.
Array[][]$time_rangesThe 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_intervalThe 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_amountThe 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_dateThe 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_timeThe 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$descriptionAn optional description for the booking. This fields was previously known as "user_free_name".
string$internal_commentAn optional comment for the booking which is intended to be used internally in the room and resource administration staff.
int$booking_typeThe booking type. 0 = normal booking 1 = reservation 2 = lock booking
bool$force_bookingIf this parameter is set to true, overlapping bookings are removed before storing this booking.
Exceptions
InvalidArgumentExceptionIf no time ranges are specified or if there is an error regarding the time ranges.
ResourceBookingRangeExceptionIf $range_id is not set.
ResourceBookingOverlapExceptionIf the booking overlaps with another booking or a resource lock.
ResourcePermissionExceptionIf the specified user does not have sufficient permissions to create a resource booking.
ResourceBookingExceptionIf the repetition interval is invalid or if the resource booking cannot be stored.
Returns
ResourceBooking object.

Reimplemented from Resource.

◆ createBookingFromRequest()

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.

Parameters
ResourceRequest$requestThe 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.
Exceptions
ResourceUnavailableExceptionif the resource cannot be assigned in at least one of the time ranges specified by the resource request.
ResourceRequestExceptionif the request could not be marked as resolved.
Returns
ResourceBooking[] A list of resource bookings matching the request.

Reimplemented from Resource.

◆ createFolder()

createFolder ( )

Reimplemented from Resource.

◆ createLock()

createLock ( User  $user,
DateTime  $begin,
DateTime  $end,
  $internal_comment = '' 
)

Creates a lock booking for this resource.

Parameters
User$userThe user who wishes to create a lock booking.
DateTime$beginThe begin of the lock time range.
DateTime$endThe end of the lock time range.
string$internal_commentAn optional comment for the lock booking which is intended to be used internally in the room and resource administration staff.
Exceptions
AccessDeniedExceptionIf the user does not have sufficient permissions to lock this resource.
ResourceUnavailableExceptionIf a lock booking already exists in the specified time range.
Returns
ResourceBooking A ResourceBooking object.

Reimplemented from Resource.

◆ createRequest()

createRequest ( User  $user,
  $date_range_ids = null,
  $comment = '',
  $properties = [],
  $preparation_time = 0 
)

This method creates a resource request for this resource.

Parameters
User$userThe user who wishes to create a request.
string | Array$date_range_idsOne 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$commentA comment for the resource request.
mixed[]$propertiesThe wishable properties for the resource request. The format of the array is as follows: [ 'property name' => 'property state' ]
int$preparation_timeThe requested preparation time before the begin of the requested time range. This parameter must be specified in seconds. Only positive values are accepted.
Exceptions
InvalidArgumentExceptionIf $date_range_id is not set. or no object which can provide at least one time range can be found with the specified ID.
ResourceNoTimeRangeExceptionIf no time range can be found by looking at the object, specified by its ID in $date_range_id.
ResourceUnavailableExceptionIf the resource is not available in the selected time range.
ResourceRequestExceptionIf the resource request cannot be stored.
Returns
ResourceRequest A resource request object.

Reimplemented from Resource.

◆ createSimpleBooking()

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.

See also
Resource::createBooking

Reimplemented from Resource.

◆ createSimpleRequest()

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.

Parameters
User$userThe user who wishes to create a simple request.
DateTime$beginThe begin timestamp of the request.
DateTime$endThe end timestamp of the request.
string$commentA comment for the resource request.
int$preparation_timeThe requested preparation time before the begin of the requested time range. This parameter must be specified in seconds. Only positive values are accepted.
Exceptions
AccessDeniedExceptionIf the user is not permitted to request this resource.
InvalidArgumentExceptionIf 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.
ResourceUnavailableExceptionIf the resource is not available in the selected time range.
ResourceRequestExceptionIf the resource request cannot be stored.
Returns
ResourceRequest A resource request object.

Reimplemented from Resource.

◆ getFolder()

getFolder ( )

Reimplemented from Resource.

◆ getFullName()

getFullName ( )

Returns the full (localised) name of the resource.

Returns
string The full name of the resource.

Reimplemented from Resource.

◆ getIcon()

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.

Returns
Icon The icon for the resource.

Reimplemented from Resource.

Here is the call graph for this function:

◆ getItemAvatarURL()

getItemAvatarURL ( )

Returns the URL to the avatar image or icon of the object, if applicable.

Returns
string|null Either the URL to the object's avatar or icon or null, if the object does not have an avatar.

Reimplemented from Resource.

Here is the call graph for this function:

◆ getOpenResourceRequests()

getOpenResourceRequests ( DateTime  $begin,
DateTime  $end 
)

Get all resource requests for the resource in a given timeframe.

Parameters
DateTime$beginBegin of timeframe.
DateTime$endEnd of timeframe.
Returns
SimpleORMapCollection Collection of ResourceRequest objects.

Reimplemented from Resource.

◆ getProperty()

getProperty (   $name = '')

Returns the state of the property specified by $name. If the property has not been set for this resource, but is defined for this resource's category, a new ResourceProperty object will be created, stored and its state will be returned.

Parameters
string$nameThe name of the resource property.
Returns
string|null The state of the specified property or null if the propery can't be found.

Reimplemented from Resource.

◆ getPropertyArray()

getPropertyArray (   $only_requestable_properties = false)

Returns all properties in a two-dimensional array with the following property data inside of the second dimension: [ 'name' => (the property's name) 'display_name' => (the display name of the property) 'type' => (the property's type) 'state' => (the property's state) 'requestable' => (if the property is requestable or not (true or false)) ]

Parameters
bool$only_requestable_propertiesIf only requestable properties shall be returned set this to true. If all properties shall be returned, set this to false.
Returns
Array[] A two-dimensional array containing property data.

Reimplemented from Resource.

◆ getPropertyObject()

getPropertyObject (   $name = '')

Retrieves a ResourceProperty object for a property of this resource which has the specified name. If the property has not been set for this resource, but is defined for this resource's category, a new ResourceProperty object will be created, stored and returned.

Parameters
string$nameThe name of the resource property.
Exceptions
InvalidResourceCategoryExceptionIf this resource category doesn't match the category of the resource object.
Returns
ResourceProperty|null Either a ResourceProperty object for the resource property matching the specified name or null, if no resource property with the specified name can be found.

Reimplemented from Resource.

◆ getPropertyRelatedObject()

getPropertyRelatedObject (   $name = '')

Retrieves an object by the state of a property of this resource, specified by the property's name. This method is useful for properties of type user, institute or fileref. Those properties store IDs of User, Institute or FileRef objects. Therefore the IDs can be resolved directly to get the corresponding User, Institute or FileRef object directly.

Parameters
string$nameThe name of the resource property.
Returns
SimpleORMap|null A SimpleORMap-based object or null, if no such object can be retrieved from the property's state.

Reimplemented from Resource.

◆ getResourceBookings()

getResourceBookings ( DateTime  $begin,
DateTime  $end 
)

Get all resource bookings for the resource in a given timeframe.

Parameters
DateTime$beginBegin of timeframe.
DateTime$endEnd of timeframe.
Returns
SimpleORMapCollection Collection of ResourceBooking objects.

Reimplemented from Resource.

◆ getResourceLocks()

getResourceLocks ( DateTime  $begin,
DateTime  $end 
)

Get all resource locks for the resource in a given timeframe.

Parameters
DateTime$beginBegin of timeframe.
DateTime$endEnd of timeframe.
Returns
SimpleORMapCollection Collection of ResourceBooking objects.

Reimplemented from Resource.

◆ hasFiles()

hasFiles ( )

Determines if files are attached to this resource. If a folder exists for this resource its files are counted. Depending on whether the folder has files in it or not this method returns true or false.

Returns
bool True, if there are files attached to this resource, false otherwise.

Reimplemented from Resource.

◆ isAssigned()

isAssigned ( DateTime  $begin,
DateTime  $end,
  $excluded_booking_ids = [] 
)

Shortcut method for ResourceBooking::countByResourceAndTimeRanges. Determines whether normal resource bookings exist in the specified time range.

Parameters
DateTime$beginTime range start timestamp.
DateTime$endTime range end timestamp.
$excluded_lock_idsThe IDs of bookings that shall be excluded from the determination of the "assigned" status.
Returns
bool True, if the resource is assigned in the specified time range, false otherwise.

Reimplemented from Resource.

◆ isAvailable()

isAvailable ( DateTime  $begin,
DateTime  $end,
  $excluded_booking_ids = [] 
)

Determines, if the resource is available (not assigned or locked) in a specified time range.

Parameters
DateTime$beginTime range start timestamp.
DateTime$endTime range end timestamp.
$excluded_booking_idsThe IDs of available bookings that shall be excluded from the determination of the "available" status.
Returns
bool True, if the resource is available in the specified time range, false otherwise.

Reimplemented from Resource.

◆ isAvailableForRequest()

isAvailableForRequest ( ResourceRequest  $request)

Determines, if the resource is available (not assigned or locked) in the time ranges specified by a resource request.

Parameters
ResourceRequest$requestA resource request object.
Returns
bool True, if the resource is available in the time ranges of the resource request, false otherwise.

Reimplemented from Resource.

◆ isLocked()

isLocked ( DateTime  $begin,
DateTime  $end,
  $excluded_lock_ids = [] 
)

Shortcut method for ResourceBooking::countByResourceAndTimeRanges. Determines whether resource locks exist in the specified time range.

Parameters
DateTime$beginTime range start timestamp.
DateTime$endTime range end timestamp.
$excluded_lock_idsThe IDs of lock bookings that shall be excluded from the determination of the "locked" status.
Returns
bool True, if the resource is locked in the specified time range, false otherwise.

Reimplemented from Resource.

◆ isPropertyEditable()

isPropertyEditable (   $name = '',
User  $user 
)

Determines if the specified user has sufficient permissions to edit the property specified by its name.

Parameters
string$nameThe name of the resource property.
user$userThe user whose edit permissions shall be checked.
Returns
bool True, if the user has edit permissions for the property, false otherwise.

Reimplemented from Resource.

◆ isReserved()

isReserved ( DateTime  $begin,
DateTime  $end,
  $excluded_reservation_ids = [] 
)

Shortcut method for ResourceBooking::countByResourceAndTimeRanges. Determines whether resource reservations exist in the specified time range.

Parameters
DateTime$beginTime range start timestamp.
DateTime$endTime range end timestamp.
$excluded_lock_idsThe IDs of reservation bookings that shall be excluded from the determination of the "reserved" status.
Returns
bool True, if the resource is reserved in the specified time range, false otherwise.

Reimplemented from Resource.

◆ propertyExists()

propertyExists (   $name = '')

Determines wheter this resource has a property with the specified name.

Parameters
string$nameThe name of the resource property.
Returns
bool True, if this resource has a property with the specified name, false otherwise.

Reimplemented from Resource.

◆ setFolder()

setFolder ( ResourceFolder  $folder)

Reimplemented from Resource.

◆ setProperty()

setProperty (   $name = '',
  $state = '',
  $user = null 
)

Sets a specified property of this resource to the specified state. If the property has not been set for this resource, but is defined for this resource's category, a new ResourceProperty object will be created, stored and its state will be returned.

Parameters
string$nameThe name of the resource property.
mixed$stateThe state of the resource property.
User | null$userdThe user who wishes to set the property.
Returns
True, if the property state could be set, false otherwise.

Reimplemented from Resource.

◆ setPropertyByDefinitionId()

setPropertyByDefinitionId (   $property_definition_id = null,
  $state = null 
)

Sets the state of a property by its definition_id rather than its name.

Parameters
string$property_definition_idThe definition-ID of the property.
string$stateThe state of the property.
Exceptions
ResourcePropertyStateExceptionIf the provided state is invalid for the specified resource property.
Returns
bool True, if the property state can be stored, false otherwise.

Reimplemented from Resource.

◆ setPropertyRelatedObject()

setPropertyRelatedObject (   $name = '',
  $object = null 
)

Sets the property state by specifying an SimpleORMap object. This method is meant for resource properties of type user, institute or fileref.

Parameters
string$nameThe name of the resource property.
SimpleORMap$objectThe object for the resource property.
Returns
bool True, if the property has been saved, false otherwise.

Reimplemented from Resource.


The documentation for this class was generated from the following file: