Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
buildereventconnectionfromdm.php
1<?php
2
4
8use Bitrix\Calendar\Internals\EO_EventConnection;
11
13{
17 private EO_EventConnection $entity;
18
22 public function __construct(EO_EventConnection $link)
23 {
24 $this->entity = $link;
25 }
26
27 public function build(): EventConnection
28 {
29 return (new EventConnection())
30 ->setId($this->getId())
31 ->setEntityTag($this->getEntityTag())
32 ->setVendorVersionId($this->entity->getVendorVersionId())
33 ->setRecurrenceId($this->entity->getRecurrenceId())
34 ->setLastSyncStatus($this->getLastSyncStatus())
35 ->setVendorEventId($this->getVendorEventId())
36 ->setVersion($this->getVersion())
37 ->setData($this->entity->getData())
38 ->setConnection($this->getConnection())
39 ->setEvent($this->getEvent())
40 ;
41 }
42
43 private function getId(): int
44 {
45 return $this->entity->getId();
46 }
47
48 private function getEntityTag(): ?string
49 {
50 return $this->entity->getEntityTag();
51 }
52
53 private function getLastSyncStatus(): ?string
54 {
55 return $this->entity->getSyncStatus();
56 }
57
58 private function getVendorEventId(): ?string
59 {
60 return $this->entity->getVendorEventId();
61 }
62
63 private function getVersion(): ?string
64 {
65 return $this->entity->getVersion();
66 }
67
68 private function getConnection(): Connection
69 {
70 return (new BuilderConnectionFromDM($this->entity->getConnection()))->build();
71 }
72
73 private function getEvent(): Event
74 {
75 return (new EventBuilderFromEntityObject($this->entity->getEvent()))->build();
76 }
77}