Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
eventwithentityattendeesfindrule.php
1<?php
2
4
8
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}