From 87d8d94f8dd51f118828972bb269505df88da5cd Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 17 Aug 2009 13:06:15 -0400 Subject: [PATCH] Start stubbing out some ideas for Kronolith_Resource implementation --- kronolith/lib/Resource.php | 40 ++++++++++++++++++ kronolith/lib/Resource/{Resource.php => Base.php} | 51 +++++++++-------------- 2 files changed, 59 insertions(+), 32 deletions(-) create mode 100644 kronolith/lib/Resource.php rename kronolith/lib/Resource/{Resource.php => Base.php} (60%) diff --git a/kronolith/lib/Resource.php b/kronolith/lib/Resource.php new file mode 100644 index 000000000..d822783f9 --- /dev/null +++ b/kronolith/lib/Resource.php @@ -0,0 +1,40 @@ +_uid = $params['id']; + } + $this->_params = $params; } @@ -30,29 +36,26 @@ class Kronolith_Resource return $this->_params[$property]; } - /** + * Should this take an event, or a time range? * * @param $startTime * @param $endTime * @return unknown_type */ - public function isFree($startTime, $endTime) - { - //Should this take an event also, instead? - } + abstract public function isFree($startTime, $endTime); /** * Adds $event to this resource's calendar - thus blocking the time - * for any other event. + * for any other event. Also responsible for setting the attendence status + * for the resource in the event object. i.e. calling addResource() (just + * like updating an attendee is done by calling addAttendee on the same + * attendee again). * * @param $event * @return unknown_type */ - public function attachToEvent($event) - { - - } + abstract public function attachToEvent($event); /** * Remove this event from resource's calendar @@ -60,30 +63,14 @@ class Kronolith_Resource * @param $event * @return unknown_type */ - public function detachFromEvent($event) - { - - } + abstract public function detachFromEvent($event); /** - * + * Obtain the freebusy information for this resource. Takes into account + * if this is a group of resources or not. (Returns the cumulative FB info + * for all the resources in the group. * @return unknown_type */ - static public function listResources($params) - { - // Query kronolith_resource table for all(?) available resources? - // maybe by 'type' or 'name'? type would be arbitrary? - } - - /** - * Adds a new resource to storage - * - * @param $params - * @return unknown_type - */ - static public function addResource($params) - { - - } + abstract public function getFreeBusy(); } \ No newline at end of file -- 2.11.0