1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
builderconnectionfromarray.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Sync\Builders;
4
5use Bitrix\Calendar\Core\Base\BaseException;
6use Bitrix\Calendar\Core\Base\Date;
7use Bitrix\Calendar\Core\Role\Helper;
8use Bitrix\Calendar\Core\Role\Role;
9use Bitrix\Calendar\Sync\Vendor\Vendor;
10use Bitrix\Calendar\Sync\Vendor\VendorInterface;
11use Bitrix\Main\ArgumentException;
12use Bitrix\Main\ObjectException;
13use Bitrix\Main\ObjectPropertyException;
14use Bitrix\Main\SystemException;
15use Bitrix\Main\Type\DateTime;
16
18{
19
20 public function __construct(array $data)
21 {
22 parent::__construct($data);
23 }
24
25 protected function getId(): int
26 {
27 return $this->data['ID'];
28 }
29
30 protected function getName(): string
31 {
32 return $this->data['NAME'] ?? '';
33 }
34
40 protected function getLastSyncTime(): ?Date
41 {
42 // TODO: move date format to helper
43 return $this->data['SYNCHRONIZED']
44 ? new Date(new DateTime($this->data['SYNCHRONIZED'], 'Y-m-d H:i:s'))
45 : null;
46 }
47
51 protected function getToken(): ?string
52 {
53 return $this->data['SYNC_TOKEN'] ?? null;
54 }
55
59 protected function getStatus(): ?string
60 {
61 return $this->data['LAST_RESULT'];
62 }
63
69 protected function getVendor(): ?VendorInterface
70 {
71 return new Vendor($this->data);
72 }
73
81 protected function getOwner(): ?Role
82 {
83 try
84 {
85 return Helper::getRole(
86 $this->data['ENTITY_ID'],
87 $this->data['ENTITY_TYPE']
88 );
89 }
90 catch (BaseException $e)
91 {
92 return null;
93 }
94 }
95
99 protected function isDeleted(): bool
100 {
101 return $this->data['IS_DELETED'] === 'Y';
102 }
103
109 protected function getNextSyncTry(): ?Date
110 {
111 // TODO: move date format to helper
112 return $this->data['NEXT_SYNC_TRY']
113 ? new Date(new DateTime($this->data['NEXT_SYNC_TRY'], 'Y-m-d H:i:s'))
114 : null;
115 }
116}
Определения date.php:9
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804