Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
CalendarCollection.php
1<?php
2
4
5use Bitrix\Im\V2\Common\ContextCustomer;
9use CCalendarEvent;
10
12{
13 public static function getRestEntityName(): string
14 {
15 return 'calendars';
16 }
17
18 public static function initByGetListArray(array $calendarsInfo): self
19 {
20 $calendars = new static();
21
22 foreach ($calendarsInfo as $calendarInfo)
23 {
24 $calendars[] = CalendarItem::initByGetListArray($calendarInfo);
25 }
26
27 return $calendars;
28 }
29
30 public static function initByIds(array $ids, ?Context $context = null): self
31 {
32 $context = $context ?? Locator::getContext();
33 $checkPermissions = false;
34
35 if (empty($ids))
36 {
37 return (new static())->setContext($context);
38 }
39
40 $calendarGetList = CCalendarEvent::GetList([
41 'arFilter' => [
42 'ID' => $ids,
43 'DELETED' => false,
44 ],
45 'parseRecursion' => false,
46 'fetchAttendees' => true,
47 'userId' => $context->getUserId(),
48 'fetchMeetings' => false,
49 'setDefaultLimit' => false,
50 'checkPermissions' => $checkPermissions,
51 ]);
52
53 return static::initByGetListArray($calendarGetList)->setContext($context);
54 }
55}
static initByIds(array $ids, ?Context $context=null)
static initByGetListArray(array $calendarInfo)