ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCalendarScheduleFilterBookingPool Class Reference

Calendar schedule filter for booking pool reservations. More...

+ Inheritance diagram for ilCalendarScheduleFilterBookingPool:
+ Collaboration diagram for ilCalendarScheduleFilterBookingPool:

Public Member Functions

 __construct ($a_user_id)
 ilCalendarScheduleFilterBookingPool constructor. More...
 
 filterCategories (array $a_cats)
 
 modifyEvent (ilCalendarEntry $a_event)
 
 addCustomEvents (ilDate $start, ilDate $end, array $a_categories)
 

Protected Member Functions

 isBookingPoolCategory ($a_cat_id)
 

Protected Attributes

 $user_id
 
 $cats
 

Detailed Description

Calendar schedule filter for booking pool reservations.

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 13 of file class.ilCalendarScheduleFilterBookingPool.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarScheduleFilterBookingPool::__construct (   $a_user_id)

ilCalendarScheduleFilterBookingPool constructor.

Parameters
int$a_user_id

Definition at line 29 of file class.ilCalendarScheduleFilterBookingPool.php.

References ilCalendarCategories\_getInstance().

30  {
31  $this->user_id = $a_user_id;
32  $this->cats = ilCalendarCategories::_getInstance();
33  }
static _getInstance($a_usr_id=0)
get singleton instance
+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomEvents()

ilCalendarScheduleFilterBookingPool::addCustomEvents ( ilDate  $start,
ilDate  $end,
array  $a_categories 
)
Parameters
ilDate$start
ilDate$end
array$a_categories

Implements ilCalendarScheduleFilter.

Definition at line 74 of file class.ilCalendarScheduleFilterBookingPool.php.

75  {
76  //TODO if necessary.
77  }

◆ filterCategories()

ilCalendarScheduleFilterBookingPool::filterCategories ( array  $a_cats)
Parameters
array$a_cats
Returns
array

Implements ilCalendarScheduleFilter.

Definition at line 39 of file class.ilCalendarScheduleFilterBookingPool.php.

40  {
41  return $a_cats;
42  }

◆ isBookingPoolCategory()

ilCalendarScheduleFilterBookingPool::isBookingPoolCategory (   $a_cat_id)
protected
Parameters
$a_cat_id
Returns
null|ilCalendarCategory

Definition at line 83 of file class.ilCalendarScheduleFilterBookingPool.php.

References ilCalendarCategory\getInstanceByCategoryId(), and ilCalendarCategory\TYPE_BOOK.

Referenced by modifyEvent().

84  {
85  $category = ilCalendarCategory::getInstanceByCategoryId($a_cat_id);
86 
87  $cat_type = (int) $category->getType();
88 
89  if ($cat_type === ilCalendarCategory::TYPE_BOOK) {
90  return $category;
91  }
92 
93  return null;
94  }
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyEvent()

ilCalendarScheduleFilterBookingPool::modifyEvent ( ilCalendarEntry  $a_event)
Parameters
ilCalendarEntry$a_event
Returns
ilCalendarEntry
Exceptions
ilDateTimeException

booking pool reservations are stored in the database with ending time excluded. Keeping it 1 second under the entered end date. e.g. Event from 10:00 to 11:00 is stored 10:00 to 10:59 using timestamps. incrementing 1 second avoid titles/zip folders using this -1 second representation.

Implements ilCalendarScheduleFilter.

Definition at line 49 of file class.ilCalendarScheduleFilterBookingPool.php.

References $end, ilCalendarCategoryAssignments\_lookupCategory(), ilCalendarEntry\getEnd(), ilCalendarEntry\getEntryId(), IL_CAL_UNIX, isBookingPoolCategory(), and ilCalendarEntry\setEnd().

50  {
52 
53  if ($category) {
60  $end = $a_event->getEnd()->get(IL_CAL_UNIX);
61  $new_end = new ilDateTime($end + 1, IL_CAL_UNIX);
62 
63  $a_event->setEnd($new_end);
64  }
65 
66  return $a_event;
67  }
static _lookupCategory($a_cal_id)
Lookup category id.
$end
Definition: saml1-acs.php:18
getEntryId()
get entry id
const IL_CAL_UNIX
getEnd()
get end public
Date and time handling
setEnd($a_end)
set end public
+ Here is the call graph for this function:

Field Documentation

◆ $cats

ilCalendarScheduleFilterBookingPool::$cats
protected

◆ $user_id

ilCalendarScheduleFilterBookingPool::$user_id
protected

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