Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sharingaccessibilitymanager.php
1<?php
2
4
6
8{
10 private array $userIds;
12 private int $timestampFrom;
14 private int $timestampTo;
15
19 public function __construct($options)
20 {
21 $this->userIds = $options['userIds'];
22 $this->timestampFrom = $options['timestampFrom'];
23 $this->timestampTo = $options['timestampTo'];
24 }
25
29 public function checkUsersAccessibility(): bool
30 {
31 $busyUserIds = (new Accessibility())
32 ->setCheckPermissions(false)
33 ->getBusyUsersIds($this->userIds, $this->timestampFrom, $this->timestampTo)
34 ;
35
36 return empty($busyUserIds);
37 }
38
43 public function getUsersAccessibilitySegmentsInUtc(): array
44 {
45 $accessibility = (new Accessibility())
46 ->setCheckPermissions(false)
47 ->getAccessibility($this->userIds, $this->timestampFrom, $this->timestampTo)
48 ;
49
50 return array_merge(...$accessibility);
51 }
52}