Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
builderpushfromdm.php
1<?php
2
4
7use Bitrix\Calendar\Internals\EO_Push;
11
12class BuilderPushFromDM implements Builder
13{
14 private EO_Push $push;
15
19 public function __construct(EO_Push $push)
20 {
21 $this->push = $push;
22 }
23
29 public function build(): Push
30 {
31 return ( new Push())
32 ->setEntityType($this->push->getEntityType())
33 ->setEntityId($this->push->getEntityId())
34 ->setChannelId($this->push->getChannelId())
35 ->setResourceId($this->push->getResourceId())
36 ->setExpireDate($this->getExpireDate())
37 ->setProcessStatus($this->push->getNotProcessed() ?? Dictionary::PUSH_STATUS_PROCESS['unblocked'])
38 ->setFirstPushDate($this->getFirstPushDate())
39 ;
40 }
41
47 private function getExpireDate(): Date
48 {
49 return new Date($this->push->getExpires());
50 }
51
57 private function getFirstPushDate(): ?Date
58 {
59 return $this->push->getFirstPushDate()
60 ? new Date($this->push->getFirstPushDate())
61 : null;
62 }
63}
setEntityType(string $entityType)
Definition push.php:51