Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
job.php
1
<?php
9
namespace
Bitrix\Sender\Runtime
;
10
15
abstract
class
Job
16
{
22
public
static
function
actualizeByCampaignId
($campaignId)
23
{
24
(
new
SenderJob
())->withCampaignId($campaignId)->actualize();
25
(
new
ReiteratedJob
())->actualize();
26
}
27
33
public
static
function
actualizeByLetterId
($letterId)
34
{
35
(
new
SenderJob
())->withLetterId($letterId)->actualize();
36
(
new
ReiteratedJob
())->actualize();
37
}
38
44
public
static
function
actualizeAll
()
45
{
46
(
new
SenderJob
())->actualize();
47
(
new
ReiteratedJob
())->actualize();
48
}
49
50
protected
function
addAgent
($agentName, $interval = 60, $nextDateExec =
''
)
51
{
52
if
(!$agentName || !is_string($agentName))
53
{
54
return
;
55
}
56
57
$agent = new \CAllAgent();
58
$agent->AddAgent(
59
$agentName,
60
"sender"
,
61
"N"
,
62
(
int
) $interval,
63
null
,
64
"Y"
,
65
(
string
) $nextDateExec
66
);
67
}
68
69
protected
function
removeAgent
($agentName)
70
{
71
if
(!$agentName || !is_string($agentName))
72
{
73
return
;
74
}
75
76
$agent = new \CAllAgent();
77
$list = $agent->getList(
78
[
"ID"
=>
"DESC"
],
79
[
"MODULE_ID"
=>
"sender"
,
"NAME"
=> $agentName]
80
);
81
while
($row = $list->fetch())
82
{
83
$agent->delete($row[
"ID"
]);
84
}
85
}
86
87
protected
function
agentExists
($agentName)
88
{
89
if
(!$agentName || !is_string($agentName))
90
{
91
return
false
;
92
}
93
94
$agent = new \CAllAgent();
95
return
(
bool
)$agent->getList(
96
[
"ID"
=>
"DESC"
],
97
[
"MODULE_ID"
=>
"sender"
,
"NAME"
=> $agentName]
98
)->fetch();
99
}
100
}
Bitrix\Sender\Runtime\Job
Definition
job.php:16
Bitrix\Sender\Runtime\Job\agentExists
agentExists($agentName)
Definition
job.php:87
Bitrix\Sender\Runtime\Job\actualizeAll
static actualizeAll()
Definition
job.php:44
Bitrix\Sender\Runtime\Job\addAgent
addAgent($agentName, $interval=60, $nextDateExec='')
Definition
job.php:50
Bitrix\Sender\Runtime\Job\actualizeByCampaignId
static actualizeByCampaignId($campaignId)
Definition
job.php:22
Bitrix\Sender\Runtime\Job\actualizeByLetterId
static actualizeByLetterId($letterId)
Definition
job.php:33
Bitrix\Sender\Runtime\Job\removeAgent
removeAgent($agentName)
Definition
job.php:69
Bitrix\Sender\Runtime\ReiteratedJob
Definition
reiteratedjob.php:19
Bitrix\Sender\Runtime\SenderJob
Definition
senderjob.php:19
Bitrix\Sender\Runtime
Definition
env.php:9
modules
sender
lib
runtime
job.php
Создано системой
1.10.0