Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
recipientbuilderjob.php
1
<?php
9
namespace
Bitrix\Sender\Runtime
;
10
11
use
Bitrix\Main\Type\DateTime
;
12
17
class
RecipientBuilderJob
extends
Job
18
{
26
public
static
function
addEventAgent
(
int
$postingId)
27
{
28
(
new
SegmentDataBuilderJob
())->
addAgent
(
29
static::getAgentName((
int
)$postingId),
30
60,
31
(
new
DateTime
())->add(
'+60 seconds'
)
32
);
33
}
34
42
public
static
function
removeAgentFromDB
(
int
$postingId)
43
{
44
(
new
SegmentDataBuilderJob
())->
removeAgent
(
45
static::getAgentName((
int
)$postingId)
46
);
47
}
48
56
public
static
function
getAgentName
(
int
$postingId)
57
{
58
return
"\Bitrix\Sender\Runtime\RecipientBuilderJob::runAgent({$postingId});"
;
59
}
60
61
public
static
function
runAgent
(
int
$postingId)
62
{
63
$builder = new \Bitrix\Sender\Posting\Builder($postingId);
64
65
if
(!$builder->isResult())
66
{
67
return
self::getAgentName
($postingId);
68
}
69
70
return
''
;
71
}
72
}
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Sender\Runtime\Job
Definition
job.php:16
Bitrix\Sender\Runtime\Job\addAgent
addAgent($agentName, $interval=60, $nextDateExec='')
Definition
job.php:50
Bitrix\Sender\Runtime\Job\removeAgent
removeAgent($agentName)
Definition
job.php:69
Bitrix\Sender\Runtime\RecipientBuilderJob
Definition
recipientbuilderjob.php:18
Bitrix\Sender\Runtime\RecipientBuilderJob\getAgentName
static getAgentName(int $postingId)
Definition
recipientbuilderjob.php:56
Bitrix\Sender\Runtime\RecipientBuilderJob\removeAgentFromDB
static removeAgentFromDB(int $postingId)
Definition
recipientbuilderjob.php:42
Bitrix\Sender\Runtime\RecipientBuilderJob\runAgent
static runAgent(int $postingId)
Definition
recipientbuilderjob.php:61
Bitrix\Sender\Runtime\RecipientBuilderJob\addEventAgent
static addEventAgent(int $postingId)
Definition
recipientbuilderjob.php:26
Bitrix\Sender\Runtime\SegmentDataBuilderJob
Definition
segmentdatabuilderjob.php:18
Bitrix\Sender\Runtime
Definition
env.php:9
modules
sender
lib
runtime
recipientbuilderjob.php
Создано системой
1.10.0