Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
helper.php
1<?php
2
4
6
7class 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}
isVendorConnection(string $accountType)
Definition helper.php:70