Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
builderpushfromdm.php
1
<?php
2
3
namespace
Bitrix\Calendar\Sync\Builders
;
4
5
use
Bitrix\Calendar\Core\Base\Date
;
6
use
Bitrix\Calendar\Core\Builders\Builder
;
7
use Bitrix\Calendar\Internals\EO_Push;
8
use
Bitrix\Calendar\Sync\Dictionary
;
9
use
Bitrix\Calendar\Sync\Push\Push
;
10
use
Bitrix\Main\ObjectException
;
11
12
class
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
}
Bitrix\Calendar\Core\Base\Date
Definition
date.php:10
Bitrix\Calendar\Core\Event\Tools\Dictionary
Definition
dictionary.php:8
Bitrix\Calendar\Sync\Builders\BuilderPushFromDM
Definition
builderpushfromdm.php:13
Bitrix\Calendar\Sync\Builders\BuilderPushFromDM\build
build()
Definition
builderpushfromdm.php:29
Bitrix\Calendar\Sync\Builders\BuilderPushFromDM\__construct
__construct(EO_Push $push)
Definition
builderpushfromdm.php:19
Bitrix\Calendar\Sync\Dictionary\PUSH_STATUS_PROCESS
const PUSH_STATUS_PROCESS
Definition
dictionary.php:32
Bitrix\Calendar\Sync\Push\Push
Definition
push.php:9
Bitrix\Calendar\Sync\Push\Push\setEntityType
setEntityType(string $entityType)
Definition
push.php:51
Bitrix\Main\ObjectException
Definition
exception.php:192
Bitrix\Main\Type\Date
Definition
date.php:9
Bitrix\Calendar\Core\Builders\Builder
Definition
builder.php:6
Bitrix\Calendar\Sync\Builders
Definition
builderconnection.php:3
modules
calendar
lib
sync
builders
builderpushfromdm.php
Создано системой
1.10.0