Kronolith_Resource_Group
extends Kronolith_Resource_Base
in package
Kronolith_Resource implementation to represent a group of similar resources.
Copyright 2009-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Tags
Table of Contents
- $_id : int
- Resource's internal id
- $_lock : bool|int
- Cache the lock of this resource. If not locked, is false.
- $_params : array<string|int, mixed>
- Instance copy of parameters.
- $_share : Horde_Share_Object
- $_type : mixed
- $_driver : Kronolith_Driver_Resource
- $_selectedResource : Kronolith_Resource_Single
- Local cache for event that accepts the invitation.
- __construct() : Kronolith_Resource
- Const'r
- addEvent() : mixed
- Adds $event to an available member resource's calendar.
- get() : mixed
- Override the get method to see if we have a selected resource. If so, return the resource's property value, otherwise, return the group's property value.
- getDriver() : mixed
- Get a storage driver instance for the resource.
- getFreeBusy() : mixed
- Obtain the freebusy information for this resource.
- getId() : string
- Obtain the resource's internal identifier, taking into account whether or not we have validated/selected a resource for this group yet.
- getPermission() : mixed
- getResponse() : int
- Check availability and return an appropriate Kronolith response code.
- getResponseType() : int
- Group resources only make sense for RESPONSETYPE_AUTO
- hasPermission() : bool
- Return permission for the specified user for this Resource.
- isFree() : bool
- Determine if the resource is free during the time period for the supplied event.
- lock() : bool
- Locks the resource.
- removeEvent() : mixed
- Remove this event from resource's calendar
- save() : Kronolith_Resource_Base
- Save resource to storage.
- set() : void
- Allow setting of properties
- setId() : mixed
- Sets the current resource's id. Must not be an existing resource.
- setPermission() : mixed
- share() : mixed
- toJson() : array<string|int, mixed>
- Return this resource's parameters in a hash.
- unlock() : mixed
- Remove a previous lock.
Properties
$_id
Resource's internal id
protected
int
$_id
= ''
$_lock
Cache the lock of this resource. If not locked, is false.
protected
bool|int
$_lock
$_params
Instance copy of parameters.
protected
array<string|int, mixed>
$_params
= array()
Contains:
- name: Display name of resource.
- calendar: The calendar associated with this resource.
- description: Resource description.
- email: An email address for the resource. (Currently not used)
- members: Member resources, if this is a group.
- response_type: A RESPONSETYPE_* constant
$_share
protected
Horde_Share_Object
$_share
$_type
protected
mixed
$_type
= 'group'
$_driver
private
Kronolith_Driver_Resource
$_driver
$_selectedResource
Local cache for event that accepts the invitation.
private
Kronolith_Resource_Single
$_selectedResource
Tags
Methods
__construct()
Const'r
public
__construct(array<string|int, mixed> $params) : Kronolith_Resource
Parameters
- $params : array<string|int, mixed>
Return values
Kronolith_Resource —addEvent()
Adds $event to an available member resource's calendar.
public
addEvent(Kronolith_Event $event) : mixed
Parameters
- $event : Kronolith_Event
Tags
Return values
mixed —get()
Override the get method to see if we have a selected resource. If so, return the resource's property value, otherwise, return the group's property value.
public
get(string $property) : mixed
Parameters
- $property : string
-
The property to get.
Return values
mixed —The requested property's value.
getDriver()
Get a storage driver instance for the resource.
public
getDriver() : mixed
Return values
mixed —getFreeBusy()
Obtain the freebusy information for this resource.
public
getFreeBusy([mixed $startstamp = null ][, mixed $endstamp = null ][, mixed $asObject = false ][, mixed $json = false ]) : mixed
Parameters
- $startstamp : mixed = null
-
The starting timestamp of the fb interval.
- $endstamp : mixed = null
-
The ending timestamp of the fb interval.
- $asObject : mixed = false
-
Return the fb info as an object?
- $json : mixed = false
-
Return the fb info as JSON?
Tags
Return values
mixed —string|Horde_Icalendar_Vfreebusy The Freebusy object or the iCalendar text.
getId()
Obtain the resource's internal identifier, taking into account whether or not we have validated/selected a resource for this group yet.
public
getId() : string
Return values
string —The id.
getPermission()
public
getPermission() : mixed
Return values
mixed —getResponse()
Check availability and return an appropriate Kronolith response code.
public
getResponse(Kronolith_Event $event) : int
Parameters
- $event : Kronolith_Event
-
The event to check on
Return values
int —Kronolith::RESPONSE* constant
getResponseType()
Group resources only make sense for RESPONSETYPE_AUTO
public
getResponseType() : int
Tags
Return values
int —The response type for this resource. A Kronolith_Resource::RESPONSE_TYPE_* constant.
hasPermission()
Return permission for the specified user for this Resource.
public
hasPermission(string $user[, int $permission = Horde_Perms::READ ][, $restrict = null ]) : bool
Parameters
- $user : string
-
The user to check for.
- $permission : int = Horde_Perms::READ
-
The permission to check.
- $restrict : = null
Return values
bool —isFree()
Determine if the resource is free during the time period for the supplied event.
public
isFree(Kronolith_Event $event) : bool
Parameters
- $event : Kronolith_Event
-
The event to check availability for.
Tags
Return values
bool —lock()
Locks the resource.
public
lock() : bool
Return values
bool —True if lock succeeded, otherwise false.
removeEvent()
Remove this event from resource's calendar
public
removeEvent(Kronolith_Event $event) : mixed
Parameters
- $event : Kronolith_Event
Tags
Return values
mixed —save()
Save resource to storage.
public
save() : Kronolith_Resource_Base
Return values
Kronolith_Resource_Base —set()
Allow setting of properties
public
set(string $property, mixed $value) : void
Parameters
- $property : string
-
The property to set
- $value : mixed
-
The value to set to
Return values
void —setId()
Sets the current resource's id. Must not be an existing resource.
public
setId(int $id) : mixed
Parameters
- $id : int
-
The id for this resource
Tags
Return values
mixed —setPermission()
public
setPermission(mixed $perm) : mixed
Parameters
- $perm : mixed
Return values
mixed —share()
public
share() : mixed
Return values
mixed —toJson()
Return this resource's parameters in a hash.
public
toJson() : array<string|int, mixed>
Return values
array<string|int, mixed> —A hash suitable for JSON encoding.
unlock()
Remove a previous lock.
public
unlock() : mixed