ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCalendarScheduleFilterConsultationHourInRepository Class Reference
+ Inheritance diagram for ilCalendarScheduleFilterConsultationHourInRepository:
+ Collaboration diagram for ilCalendarScheduleFilterConsultationHourInRepository:

Public Member Functions

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

Protected Attributes

 $cats
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarScheduleFilterConsultationHourInRepository::__construct ( )

Definition at line 28 of file class.ilCalendarScheduleFilterConsultationHourInRepository.php.

29 {
31 }
static _getInstance($a_usr_id=0)
get singleton instance

References ilCalendarCategories\_getInstance().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomEvents()

ilCalendarScheduleFilterConsultationHourInRepository::addCustomEvents ( ilDate  $start,
ilDate  $end,
array  $a_categories 
)

Implements ilCalendarScheduleFilter.

Definition at line 68 of file class.ilCalendarScheduleFilterConsultationHourInRepository.php.

68 : array
69 {
70 return [];
71 }

◆ filterCategories()

ilCalendarScheduleFilterConsultationHourInRepository::filterCategories ( array  $a_cats)

Implements ilCalendarScheduleFilter.

Definition at line 33 of file class.ilCalendarScheduleFilterConsultationHourInRepository.php.

33 : array
34 {
35 return $a_cats;
36 }

◆ modifyEvent()

ilCalendarScheduleFilterConsultationHourInRepository::modifyEvent ( ilCalendarEntry  $a_event)

Implements ilCalendarScheduleFilter.

Definition at line 38 of file class.ilCalendarScheduleFilterConsultationHourInRepository.php.

39 {
40 /*
41 * Do not filter if not in repository object context, or if
42 * the entry is not from a consultation hour category.
43 */
44 if (
45 $this->cats->getMode() !== ilCalendarCategories::MODE_REPOSITORY ||
46 !$this->cats->getSourceRefId()
47 ) {
48 return $a_event;
49 }
50 foreach (ilCalendarCategoryAssignments::_lookupCategories($a_event->getEntryId()) as $category_id) {
51 if (((int) $this->cats->getCategoryInfo($category_id)['type']) !== ilCalendarCategory::TYPE_CH) {
52 return $a_event;
53 }
54 }
55
56 $booking = new ilBookingEntry($a_event->getContextId());
57
58 /*
59 * Only show consultation hour entries assigned to the current object,
60 * or those without assignment.
61 */
62 if ($booking->isTargetObjectVisible($this->cats->getSourceRefId())) {
63 return $a_event;
64 }
65 return null;
66 }
Booking definition.
static _lookupCategories($a_cal_id)
lookup categories
Model for a calendar entry.
getContextId()
get context id

References ilCalendarCategoryAssignments\_lookupCategories(), ilCalendarEntry\getContextId(), ilCalendarEntry\getEntryId(), ilCalendarCategories\MODE_REPOSITORY, and ilCalendarCategory\TYPE_CH.

+ Here is the call graph for this function:

Field Documentation

◆ $cats

ilCalendarScheduleFilterConsultationHourInRepository::$cats
protected

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