Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
helper.php
1
<?php
2
3
namespace
Bitrix\Calendar\Sync\Office365
;
4
5
use
Bitrix\Calendar\Core\Base\Date
;
6
7
class
Helper
8
{
9
public
const
TYPE
=
'office365'
;
10
public
const
ACCOUNT_TYPE
=
'office365'
;
11
public
const
SERVER_PATH_V1
=
'https://graph.microsoft.com/v1.0/'
;
12
public
const
SERVER_PATH
= self::SERVER_PATH_V1;
13
14
public
const
TIME_FORMAT_LONG
=
'Y-m-d\TH:i:s.u'
;
15
16
public
const
NEED_SCOPE
= [
17
'User.Read'
,
18
'Calendars.ReadWrite'
,
19
'offline_access'
20
];
21
22
public
const
DELTA_INTERVAL
= [
23
'from'
=>
'-1 month'
,
24
'to'
=>
'+20 year'
,
25
];
26
27
public
const
EVENT_TYPES
= [
28
'single'
=>
'singleInstance'
,
29
'series'
=>
'seriesMaster'
,
30
'exception'
=>
'exception'
,
31
'occurrence'
=>
'occurrence'
,
32
'deleted'
=>
'deleted'
,
33
];
34
35
public
const
RECURRENCE_TYPES
= [
36
'daily'
=>
'daily'
,
37
'weekly'
=>
'weekly'
,
38
'absoluteMonthly'
=>
'absoluteMonthly'
,
39
'relativeMonthly'
=>
'relativeMonthly'
,
40
'absoluteYearly'
=>
'absoluteYearly'
,
41
'relativeYearly'
=>
'relativeYearly'
,
42
];
43
const
PUSH_PATH
=
'/bitrix/tools/calendar/office365push.php'
;
44
45
private
static
array $deltaInterval;
46
53
public
function
getDeltaInterval
(): array
54
{
55
if
(empty(static::$deltaInterval))
56
{
57
$from =
new
Date
();
58
$from->getDate()->add(self::DELTA_INTERVAL[
'from'
]);
59
$to =
new
Date
();
60
$to->getDate()->add(self::DELTA_INTERVAL[
'to'
]);
61
static::$deltaInterval = [
62
'from'
=> $from,
63
'to'
=>$to
64
];
65
}
66
67
return
static::$deltaInterval;
68
}
69
70
public
function
isVendorConnection
(
string
$accountType): bool
71
{
72
return
$accountType === self::ACCOUNT_TYPE;
73
}
74
}
Bitrix\Calendar\Core\Base\Date
Definition
date.php:10
Bitrix\Calendar\Sync\Google\Helper
Definition
helper.php:13
Bitrix\Calendar\Sync\Google\Helper\NEED_SCOPE
const NEED_SCOPE
Definition
helper.php:37
Bitrix\Calendar\Sync\Office365\Helper\isVendorConnection
isVendorConnection(string $accountType)
Definition
helper.php:70
Bitrix\Calendar\Sync\Office365\Helper\ACCOUNT_TYPE
const ACCOUNT_TYPE
Definition
helper.php:10
Bitrix\Calendar\Sync\Office365\Helper\PUSH_PATH
const PUSH_PATH
Definition
helper.php:43
Bitrix\Calendar\Sync\Office365\Helper\SERVER_PATH_V1
const SERVER_PATH_V1
Definition
helper.php:11
Bitrix\Calendar\Sync\Office365\Helper\SERVER_PATH
const SERVER_PATH
Definition
helper.php:12
Bitrix\Calendar\Sync\Office365\Helper\DELTA_INTERVAL
const DELTA_INTERVAL
Definition
helper.php:22
Bitrix\Calendar\Sync\Office365\Helper\TYPE
const TYPE
Definition
helper.php:9
Bitrix\Calendar\Sync\Office365\Helper\RECURRENCE_TYPES
const RECURRENCE_TYPES
Definition
helper.php:35
Bitrix\Calendar\Sync\Office365\Helper\EVENT_TYPES
const EVENT_TYPES
Definition
helper.php:27
Bitrix\Calendar\Sync\Office365\Helper\TIME_FORMAT_LONG
const TIME_FORMAT_LONG
Definition
helper.php:14
Bitrix\Calendar\Sync\Office365\Helper\getDeltaInterval
getDeltaInterval()
Definition
helper.php:53
Bitrix\Calendar\Sync\Office365
Definition
abstractmanager.php:3
modules
calendar
lib
sync
office365
helper.php
Создано системой
1.10.0