ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCalendarScheduleFilterConsultationHourInRepository Class Reference
+ Inheritance diagram for ilCalendarScheduleFilterConsultationHourInRepository:
+ Collaboration diagram for ilCalendarScheduleFilterConsultationHourInRepository:

Public Member Functions

 __construct ()
 
 filterCategories (array $a_cats)
 
 modifyEvent (ilCalendarEntry $a_event)
 Modifies event properties. More...
 
 addCustomEvents (ilDate $start, ilDate $end, array $a_categories)
 Add (return) an array of custom ilCalendarEntry's. More...
 

Protected Attributes

ilCalendarCategories $cats
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarScheduleFilterConsultationHourInRepository::__construct ( )

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

References ilCalendarCategories\_getInstance().

26  {
27  $this->cats = ilCalendarCategories::_getInstance();
28  }
static _getInstance($a_usr_id=0)
get singleton instance
+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomEvents()

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

Add (return) an array of custom ilCalendarEntry's.

Parameters
ilDate$start
ilDate$end
array$a_categories
Returns
ilCalendarEntry[]

Implements ilCalendarScheduleFilter.

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

65  : array
66  {
67  return [];
68  }

◆ filterCategories()

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

Implements ilCalendarScheduleFilter.

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

30  : array
31  {
32  return $a_cats;
33  }

◆ modifyEvent()

ilCalendarScheduleFilterConsultationHourInRepository::modifyEvent ( ilCalendarEntry  $a_event)

Modifies event properties.

Return null to hide the event.

Parameters
ilCalendarEntry$a_event
Returns
ilCalendarEntry|null

Implements ilCalendarScheduleFilter.

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

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

36  {
37  /*
38  * Do not filter if not in repository object context, or if
39  * the entry is not from a consultation hour category.
40  */
41  if (
42  $this->cats->getMode() !== ilCalendarCategories::MODE_REPOSITORY ||
43  !$this->cats->getSourceRefId()
44  ) {
45  return $a_event;
46  }
47  foreach (ilCalendarCategoryAssignments::_lookupCategories($a_event->getEntryId()) as $category_id) {
48  if (((int) $this->cats->getCategoryInfo($category_id)['type']) !== ilCalendarCategory::TYPE_CH) {
49  return $a_event;
50  }
51  }
52 
53  $booking = new ilBookingEntry($a_event->getContextId());
54 
55  /*
56  * Only show consultation hour entries assigned to the current object,
57  * or those without assignment.
58  */
59  if ($booking->isTargetObjectVisible($this->cats->getSourceRefId())) {
60  return $a_event;
61  }
62  return null;
63  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Field Documentation

◆ $cats

ilCalendarCategories ilCalendarScheduleFilterConsultationHourInRepository::$cats
protected

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