24 public static function find(
31 $context = $context ?? Locator::getContext();
33 $calendarOrder = [
'ID' =>
'DESC'];
35 if (isset($order[
'ID']))
37 $calendarOrder[
'ID'] = $order[
'ID'];
40 $query = LinkCalendarTable::query();
43 ->setOrder($calendarOrder)
47 $query->setLimit($limit);
49 static::processFilters($query, $filter, $calendarOrder);
51 $links =
new static($query->fetchCollection());
52 $links->setContext($context);
54 return $links->fillCalendarData();
81 static::processSidebarFilters($query, $filter, $order);
83 if (isset($filter[
'CALENDAR_DATE_FROM']))
85 $query->where(
'CALENDAR_DATE_FROM',
'>=', $filter[
'CALENDAR_DATE_FROM']);
88 if (isset($filter[
'CALENDAR_DATE_TO']))
90 $query->where(
'CALENDAR_DATE_TO',
'<=', $filter[
'CALENDAR_DATE_TO']);
93 if (isset($filter[
'SEARCH_TITLE']))
95 $query->withSearchByTitle($filter[
'SEARCH_TITLE']);