Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
tenthreadsstrategy.php
1
<?php
2
3
namespace
Bitrix\Sender\Posting\ThreadStrategy
;
4
5
use Bitrix\Main\Entity\ReferenceField;
6
use
Bitrix\Main\ORM\Fields\ExpressionField
;
7
use
Bitrix\Sender\Internals\Model\PostingThreadTable
;
8
use
Bitrix\Sender\PostingRecipientTable
;
9
10
class
TenThreadsStrategy
extends
AbstractThreadStrategy
11
{
12
public
const
THREADS_COUNT
= 10;
13
14
protected
function
setFilter
(): void
15
{
16
parent::setFilter();
17
$this->filter += [
18
'=POSTING_ID'
=>
$this->postingId
,
19
'@STATUS'
=> [
PostingRecipientTable::SEND_RESULT_NONE
,
PostingRecipientTable::SEND_RESULT_WAIT_ACCEPT
],
20
'=LAST_DIGIT'
=>
$this->threadId
,
21
];
22
}
23
24
protected
function
setRuntime
(): void
25
{
26
$this->runtime = [
27
new
ReferenceField(
28
'MAILING_SUB'
,
'Bitrix\\Sender\\MailingSubscriptionTable'
, [
29
'=this.CONTACT_ID'
=>
'ref.CONTACT_ID'
,
30
'=this.POSTING.MAILING_ID'
=>
'ref.MAILING_ID'
31
], [
'join_type'
=>
'LEFT'
]
32
),
33
new
ExpressionField
(
34
'LAST_DIGIT'
,
'RIGHT(sender_posting_recipient.ID,1)'
35
)
36
];
37
}
38
43
public
function
isProcessLimited
(): bool
44
{
45
$maxParallelExecutions = \COption::GetOptionInt(
46
"sender"
,
47
"max_parallel_threads"
,
48
10
49
);
50
51
$count = PostingThreadTable::getCount(
52
[
53
'=STATUS'
=>
PostingThreadTable::STATUS_IN_PROGRESS
,
54
]
55
);
56
57
return
$count > $maxParallelExecutions;
58
}
59
}
Bitrix\Main\ORM\Fields\ExpressionField
Definition
expressionfield.php:25
Bitrix\Sender\Internals\Model\PostingThreadTable
Definition
postingthread.php:24
Bitrix\Sender\Internals\Model\PostingThreadTable\STATUS_IN_PROGRESS
const STATUS_IN_PROGRESS
Definition
postingthread.php:26
Bitrix\Sender\Posting\ThreadStrategy\AbstractThreadStrategy
Definition
abstractthreadstrategy.php:16
Bitrix\Sender\Posting\ThreadStrategy\AbstractThreadStrategy\$postingId
$postingId
Definition
abstractthreadstrategy.php:22
Bitrix\Sender\Posting\ThreadStrategy\AbstractThreadStrategy\$threadId
$threadId
Definition
abstractthreadstrategy.php:20
Bitrix\Sender\Posting\ThreadStrategy\TenThreadsStrategy
Definition
tenthreadsstrategy.php:11
Bitrix\Sender\Posting\ThreadStrategy\TenThreadsStrategy\THREADS_COUNT
const THREADS_COUNT
Definition
tenthreadsstrategy.php:12
Bitrix\Sender\Posting\ThreadStrategy\TenThreadsStrategy\isProcessLimited
isProcessLimited()
Definition
tenthreadsstrategy.php:43
Bitrix\Sender\Posting\ThreadStrategy\TenThreadsStrategy\setFilter
setFilter()
Definition
tenthreadsstrategy.php:14
Bitrix\Sender\Posting\ThreadStrategy\TenThreadsStrategy\setRuntime
setRuntime()
Definition
tenthreadsstrategy.php:24
Bitrix\Sender\PostingRecipientTable
Definition
posting.php:663
Bitrix\Sender\PostingRecipientTable\SEND_RESULT_WAIT_ACCEPT
const SEND_RESULT_WAIT_ACCEPT
Definition
posting.php:669
Bitrix\Sender\PostingRecipientTable\SEND_RESULT_NONE
const SEND_RESULT_NONE
Definition
posting.php:664
Bitrix\Sender\Posting\ThreadStrategy
Definition
abstractthreadstrategy.php:3
modules
sender
lib
posting
threadstrategy
tenthreadsstrategy.php
Создано системой
1.10.0