ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCalendarScheduleFilterBookingPool.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
27 {
28  protected int $user_id;
30 
31  public function __construct(int $a_user_id)
32  {
33  $this->user_id = $a_user_id;
34  $this->cats = ilCalendarCategories::_getInstance();
35  }
36 
40  public function filterCategories(array $a_cats): array
41  {
42  return $a_cats;
43  }
44 
48  public function modifyEvent(ilCalendarEntry $a_event): ?ilCalendarEntry
49  {
51 
52  if ($category) {
59  $end = $a_event->getEnd()->get(IL_CAL_UNIX);
60  $new_end = new ilDateTime($end + 1, IL_CAL_UNIX);
61 
62  $a_event->setEnd($new_end);
63  }
64 
65  return $a_event;
66  }
67 
71  public function addCustomEvents(ilDate $start, ilDate $end, array $a_categories): array
72  {
73  return [];
74  }
75 
80  protected function isBookingPoolCategory(int $a_cat_id): ?ilCalendarCategory
81  {
82  $category = ilCalendarCategory::getInstanceByCategoryId($a_cat_id);
83 
84  $cat_type = $category->getType();
85 
86  if ($cat_type === ilCalendarCategory::TYPE_BOOK) {
87  return $category;
88  }
89  return null;
90  }
91 }
class for calendar categories
Stores calendar categories.
const IL_CAL_UNIX
addCustomEvents(ilDate $start, ilDate $end, array $a_categories)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getEnd()
Get end of period.
Calendar schedule filter interface.
static _getInstance($a_usr_id=0)
get singleton instance
setEnd(?ilDateTime $a_end)
Calendar schedule filter for booking pool reservations.
static getInstanceByCategoryId(int $a_cat_id)