ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCalendarScheduleFilterBookingPool Class Reference

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

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

Public Member Functions

 __construct (int $a_user_id)
 
 filterCategories (array $a_cats)
 
 modifyEvent (ilCalendarEntry $a_event)
 
 addCustomEvents (ilDate $start, ilDate $end, array $a_categories)
 

Protected Member Functions

 isBookingPoolCategory (int $a_cat_id)
 

Protected Attributes

int $user_id
 
ilCalendarCategories $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

Definition at line 12 of file ilCalendarScheduleFilterBookingPool.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarScheduleFilterBookingPool::__construct ( int  $a_user_id)

Definition at line 17 of file ilCalendarScheduleFilterBookingPool.php.

References ilCalendarCategories\_getInstance().

18  {
19  $this->user_id = $a_user_id;
20  $this->cats = ilCalendarCategories::_getInstance();
21  }
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 
)

Implements ilCalendarScheduleFilter.

Definition at line 57 of file ilCalendarScheduleFilterBookingPool.php.

57  : array
58  {
59  return [];
60  }

◆ filterCategories()

ilCalendarScheduleFilterBookingPool::filterCategories ( array  $a_cats)

Implements ilCalendarScheduleFilter.

Definition at line 26 of file ilCalendarScheduleFilterBookingPool.php.

26  : array
27  {
28  return $a_cats;
29  }

◆ isBookingPoolCategory()

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

Definition at line 66 of file ilCalendarScheduleFilterBookingPool.php.

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

Referenced by modifyEvent().

67  {
68  $category = ilCalendarCategory::getInstanceByCategoryId($a_cat_id);
69 
70  $cat_type = $category->getType();
71 
72  if ($cat_type === ilCalendarCategory::TYPE_BOOK) {
73  return $category;
74  }
75  return null;
76  }
Stores calendar categories.
static getInstanceByCategoryId(int $a_cat_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyEvent()

ilCalendarScheduleFilterBookingPool::modifyEvent ( ilCalendarEntry  $a_event)

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 34 of file ilCalendarScheduleFilterBookingPool.php.

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

35  {
37 
38  if ($category) {
45  $end = $a_event->getEnd()->get(IL_CAL_UNIX);
46  $new_end = new ilDateTime($end + 1, IL_CAL_UNIX);
47 
48  $a_event->setEnd($new_end);
49  }
50 
51  return $a_event;
52  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_UNIX
getEnd()
Get end of period.
setEnd(?ilDateTime $a_end)
+ Here is the call graph for this function:

Field Documentation

◆ $cats

ilCalendarCategories ilCalendarScheduleFilterBookingPool::$cats
protected

Definition at line 15 of file ilCalendarScheduleFilterBookingPool.php.

◆ $user_id

int ilCalendarScheduleFilterBookingPool::$user_id
protected

Definition at line 14 of file ilCalendarScheduleFilterBookingPool.php.


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