Stud.IP  5.4
Building Class Reference
Inheritance diagram for Building:
Resource SimpleORMap StudipItem

Public Member Functions

 getRequiredPropertyNames ()
 
 __toString ()
 
 cbValidate ()
 
 getFullName ()
 
 getDefaultPictureUrl ()
 
 getIcon ($role=Icon::ROLE_INFO)
 
 checkHierarchy ()
 
 getActionLink ($action='show', $link_parameters=[])
 
 getActionURL ($action='show', $url_parameters=[])
 
 findRooms ()
 
 findLocation ()
 
 addChild (Resource $resource)
 
 createSimpleBooking (User $user, DateTime $begin, DateTime $end, $preparation_time=0, $description='', $internal_comment='', $booking_type=ResourceBooking::TYPE_NORMAL)
 
 createBookingFromRequest (User $user, ResourceRequest $request, $preparation_time=0, $description='', $internal_comment='', $booking_type=ResourceBooking::TYPE_NORMAL, $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=ResourceBooking::TYPE_NORMAL, $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 ($create_if_missing=true)
 
 setFolder (ResourceFolder $folder)
 
 createFolder ()
 
 getRequiredPropertyNames ()
 
 createSimpleBooking (User $user, DateTime $begin, DateTime $end, $preparation_time=0, $description='', $internal_comment='', $booking_type=ResourceBooking::TYPE_NORMAL)
 
 createBookingFromRequest (User $user, ResourceRequest $request, $preparation_time=0, $description='', $internal_comment='', $booking_type=ResourceBooking::TYPE_NORMAL, $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=ResourceBooking::TYPE_NORMAL, $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 (string $name)
 
 getInfolabelProperties ()
 
 getProperty (string $name)
 
 getPropertyRelatedObject (string $name)
 
 setProperty (string $name, $state='', $user=null)
 
 setPropertiesByName (array $properties, User $user)
 
 setPropertiesById (array $properties, User $user=null)
 
 isPropertyEditable (string $name, User $user)
 
 setPropertyByDefinitionId ($property_definition_id=null, $state=null)
 
 setPropertyRelatedObject (string $name, SimpleORMap $object)
 
 deleteProperty (string $name, User $user)
 
 getPictureUrl ()
 
 getDefaultPictureUrl ()
 
 getIcon ($role=Icon::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, string $permission='user', array $time_range=[])
 
 userMayCreateChild (User $user)
 
 userHasRequestRights (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, array $booking_types=[0])
 
 getResourceLocks (DateTime $begin, DateTime $end)
 
 hasFiles ()
 
 getDerivedClassInstance ()
 
 checkHierarchy ()
 
 getActionLink ($action='show', $link_parameters=[])
 
 getActionURL ($action='show', $url_parameters=[])
 
 getItemName ($long_format=true)
 
 getItemURL ()
 
 getItemAvatarURL ()
 
 getLink ()
 
- 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)
 
 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 ()
 

Static Public Member Functions

static findAll ()
 
static getTranslatedClassName ($item_count=1)
 
static getRequiredProperties ()
 
static findByLocation ($location_id=null)
 
static getLinkForAction ( $action='show', $id=null, $link_parameters=[])
 
static getURLForAction ( $action='show', $id=null, $url_parameters=[])
 
- Static Public Member Functions inherited from Resource
static findChildren ($resource_id)
 
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 exists ($id)
 
static countBySql ($sql='1', $params=[])
 
static create ($data)
 
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 ($name, $arguments)
 

Static Protected Member Functions

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

Static Protected Attributes

static $required_properties
 
- Static Protected Attributes inherited from Resource
static $permission_cache
 
- 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
 

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)
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 
- Protected Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $relations = []
 
 $additional_data = []
 

Member Function Documentation

◆ __toString()

__toString ( )
See also
StudipItem::__toString

Implements StudipItem.

◆ addChild()

addChild ( Resource  $resource)

Adds a child resource to this building. The child resource must not be a resource of the class Building or Location.

Parameters
Resource$resourceThe resource which shall be added as child.
Returns
True, if the resource could be added as child, false otherwise.
Exceptions
InvalidResourceExceptionIf the specified resource belongs to the resource classes Building or Location.

◆ buildPathForAction()

static buildPathForAction (   $action = 'show',
  $id = null 
)
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.

Parameters
string$actionThe action for the building.
string$idThe ID of the building.
Returns
string The URL path for the specified action.
Exceptions
InvalidArgumentExceptionIf $building_id is empty.

◆ cbValidate()

cbValidate ( )

◆ checkHierarchy()

checkHierarchy ( )

◆ configure()

static configure (   $config = [])
staticprotected

◆ 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 = ResourceBooking::TYPE_NORMAL,
  $force_booking = false 
)

◆ createBookingFromRequest()

createBookingFromRequest ( User  $user,
ResourceRequest  $request,
  $preparation_time = 0,
  $description = '',
  $internal_comment = '',
  $booking_type = ResourceBooking::TYPE_NORMAL,
  $prepend_preparation_time = false,
  $notify_lecturers = false 
)

◆ createLock()

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

◆ createRequest()

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

◆ createSimpleBooking()

createSimpleBooking ( User  $user,
DateTime  $begin,
DateTime  $end,
  $preparation_time = 0,
  $description = '',
  $internal_comment = '',
  $booking_type = ResourceBooking::TYPE_NORMAL 
)

◆ createSimpleRequest()

createSimpleRequest ( User  $user,
DateTime  $begin,
DateTime  $end,
  $comment = '',
  $preparation_time = 0 
)

◆ findAll()

static findAll ( )
static

Returns all buildings which are stored in the database.

Returns
Building[] An array of Building objects.

◆ findByLocation()

static findByLocation (   $location_id = null)
static

Finds buildings by a location specified by its ID.

Parameters
string$location_idThe ID of the location.
Returns
Building[] An array with buildings or an empty array.

◆ findLocation()

findLocation ( )

Retrieves the location where this building is assigned to by looking up the parent resources of this building.

Returns
Location|null A Location object if it can be found, null otherwise.

◆ findRooms()

findRooms ( )

Retrieves the rooms which reside inside this building by looking up the child resources of this building.

Returns
Room[] An array with Room objects or an empty array if no rooms can be found.

◆ getActionLink()

getActionLink (   $action = 'show',
  $link_parameters = [] 
)

Returns the link for an action for this building. This is the non-static variant of Building::getLinkForAction.

Parameters
string$actionThe action which shall be executed. For buildings the actions 'show', 'booking_plan', 'add', 'edit' and 'delete' are defined.
array$link_parametersOptional parameters for the link.
Returns
string The Link for the building action.

◆ getActionURL()

getActionURL (   $action = 'show',
  $url_parameters = [] 
)

Returns the URL for an action for this building. This is the non-static variant of Building::getURLForAction.

Parameters
string$actionThe action which shall be executed. For buildings the actions 'show', 'booking_plan', 'add', 'edit' and 'delete' are defined.
array$link_parametersOptional parameters for the URL.
Returns
string The URL for the building action.

◆ getDefaultPictureUrl()

getDefaultPictureUrl ( )

Returns the path for the building's image. If the building has no image the path for a general building icon will be returned.

Returns
string The image path to the building's image.

◆ getFullName()

getFullName ( )

Returns the full (localised) name of the building.

Returns
string The full name of the building.

◆ getIcon()

getIcon (   $role = Icon::ROLE_INFO)

◆ getLinkForAction()

static getLinkForAction (   $action = 'show',
  $id = null,
  $link_parameters = [] 
)
static

Returns the appropriate link for the building action that shall be executed on a building.

Parameters
string$actionThe action which shall be executed. For buildings the actions 'show', 'booking_plan', 'add', 'edit' and 'delete' are defined.
string$idThe ID of the building on which the specified action shall be executed.
$link_parameters
Returns
string The Link for the building action.

◆ getRequiredProperties()

static getRequiredProperties ( )
static

◆ getRequiredPropertyNames()

getRequiredPropertyNames ( )

◆ getTranslatedClassName()

static getTranslatedClassName (   $item_count = 1)
static

◆ getURLForAction()

static getURLForAction (   $action = 'show',
  $id = null,
  $url_parameters = [] 
)
static

Returns the appropriate URL for the building action that shall be executed on a building.

Parameters
string$actionThe action which shall be executed. For buildings the actions 'show', 'booking_plan', 'add', 'edit' and 'delete' are defined.
string$idThe ID of the building on which the specified action shall be executed.
$url_parameters
Returns
string The URL for the building action.

◆ isAssigned()

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

◆ isAvailable()

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

◆ isLocked()

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

◆ isReserved()

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

Field Documentation

◆ $required_properties

$required_properties
staticprotected
Initial value:
= [
'address',
'number',
'geo_coordinates'
]

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