Stud.IP  6.0
Location Class Reference
Inheritance diagram for Location:
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=[])
 
 findBuildings ()
 
 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 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 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 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 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 location. The child resource must not be a resource of the Location class.

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 Location resource class.

◆ 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.

◆ 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 locations which are stored in the database.

Returns
Location[] An array of Location objects.

◆ findBuildings()

findBuildings ( )

Retrieves the buildings which are associated to this location by looking up the child resources of this location.

Returns
Building[] An array with Building objects or an empty array if no buildings 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 locations the actions 'show', '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 location. This is the non-static variant of Location::getURLForAction.

Parameters
string$actionThe action which shall be executed. For locations the actions 'show', 'add', 'edit' and 'delete' are defined.
array$url_parametersOptional parameters for the URL.
Returns
string

◆ getDefaultPictureUrl()

getDefaultPictureUrl ( )

◆ getFullName()

getFullName ( )

Returns the full (localised) name of the location.

Returns
string The full name of the location.

◆ getIcon()

getIcon (   $role = Icon::ROLE_INFO)

◆ getLinkForAction()

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

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

Parameters
string$actionThe action which shall be executed. For locations the actions 'show', 'add', 'edit' and 'delete' are defined.
string$idThe ID of the location on which the specified action shall be executed.
array$link_parametersOptional parameters for the link.
Returns
string The Link for the location action.

◆ 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 location action that shall be executed on a location.

Parameters
string$actionThe action which shall be executed. For locations the actions 'show', 'add', 'edit' and 'delete' are defined.
string$idThe ID of the location on which the specified action shall be executed.
array$url_parametersOptional parameters for the URL.
Returns
string The URL for the location 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:
= [
'geo_coordinates'
]

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