Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sharingaccessibilitymanager.php
1
<?php
2
3
namespace
Bitrix\Calendar\Sharing
;
4
5
use
Bitrix\Calendar\Core\Managers\Accessibility
;
6
7
class
SharingAccessibilityManager
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
}
Bitrix\Calendar\Core\Managers\Accessibility
Definition
accessibility.php:15
Bitrix\Calendar\Sharing\SharingAccessibilityManager
Definition
sharingaccessibilitymanager.php:8
Bitrix\Calendar\Sharing\SharingAccessibilityManager\checkUsersAccessibility
checkUsersAccessibility()
Definition
sharingaccessibilitymanager.php:29
Bitrix\Calendar\Sharing\SharingAccessibilityManager\getUsersAccessibilitySegmentsInUtc
getUsersAccessibilitySegmentsInUtc()
Definition
sharingaccessibilitymanager.php:43
Bitrix\Calendar\Sharing\SharingAccessibilityManager\__construct
__construct($options)
Definition
sharingaccessibilitymanager.php:19
Bitrix\Calendar\Sharing
Definition
analytics.php:3
modules
calendar
lib
sharing
sharingaccessibilitymanager.php
Создано системой
1.10.0