Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
eventwithentityattendeesfindrule.php
1
<?php
2
3
namespace
Bitrix\Calendar\Core\Queue\Rule\Rules
;
4
5
use
Bitrix\Calendar\Core\Queue\Queue
;
6
use
Bitrix\Calendar\Core\Queue\Interfaces
;
7
use
Bitrix\Calendar\Core\Queue\Message\Dictionary
;
8
9
class
EventWithEntityAttendeesFindRule
extends
DbRule
10
{
11
private
const
ROUTING_KEY =
'calendar:find_events_with_entity_attendees'
;
12
17
protected
function
getTargetQueue
(Interfaces\
Message
$message): ?
Queue
\
Queue
18
{
19
$routingKey = $message->getHeaders()[Dictionary::HEADER_KEYS[
'routingKey'
]] ??
null
;
20
if
($routingKey === self::ROUTING_KEY)
21
{
22
return
(
new
Queue
\
QueueFactory
())->getById(
Queue
\QueueRegistry::QUEUE_LIST[
'EventsWithEntityAttendeesFind'
]);
23
}
24
25
return
null
;
26
}
27
32
protected
function
getMessageHash
(Interfaces\
Message
$message): string
33
{
34
$data = $message->getBody();
35
$hash =
'calendar_attendee_entity_'
. $data[
'entityType'
];
36
if
($data[
'entityId'
])
37
{
38
$hash .=
'_'
. $data[
'entityId'
];
39
}
40
41
return
$hash;
42
}
43
}
Bitrix\Calendar\Core\Queue\Message\Dictionary
Definition
dictionary.php:6
Bitrix\Calendar\Core\Queue\Queue\QueueFactory
Definition
queuefactory.php:6
Bitrix\Calendar\Core\Queue\Rule\Rules\DbRule
Definition
dbrule.php:12
Bitrix\Calendar\Core\Queue\Rule\Rules\EventWithEntityAttendeesFindRule
Definition
eventwithentityattendeesfindrule.php:10
Bitrix\Calendar\Core\Queue\Rule\Rules\EventWithEntityAttendeesFindRule\getMessageHash
getMessageHash(Interfaces\Message $message)
Definition
eventwithentityattendeesfindrule.php:32
Bitrix\Calendar\Core\Queue\Rule\Rules\EventWithEntityAttendeesFindRule\getTargetQueue
getTargetQueue(Interfaces\Message $message)
Definition
eventwithentityattendeesfindrule.php:17
Bitrix\Calendar\Core\Queue\Interfaces\Message
Definition
message.php:16
Bitrix\Calendar\Core\Queue\Interfaces\Queue
Definition
queue.php:5
Bitrix\Calendar\Core\Queue\Interfaces
Definition
consumer.php:3
Bitrix\Calendar\Core\Queue\Queue
Definition
queue.php:3
Bitrix\Calendar\Core\Queue\Rule\Rules
Definition
dbrule.php:3
modules
calendar
lib
core
queue
rule
rules
eventwithentityattendeesfindrule.php
Создано системой
1.10.0