EventsWithEntityAttendeesFind::process

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. EventsWithEntityAttendeesFind
  4. process
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/core/queue/processor/eventswithentityattendeesfind.php
  • Класс: BitrixCalendarCoreQueueProcessorEventsWithEntityAttendeesFind
  • Вызов: EventsWithEntityAttendeesFind::process
public function process(InterfacesMessage $message): string
{
	$data = $message->getBody();

	if (empty($data['entityType']))
	{
		return self::REJECT;
	}

	$attendeeCode = $this->convertEntityToAttendeeCode($data['entityType'], $data['entityId'] ?? null);

	$events = EventTable::getList([
		'select' => ['ID'],
		'filter' => BitrixMainORMQueryQuery::filter()
			->where('DELETED', 'N')
			->whereExpr("%s REGEXP '" . $attendeeCode."(_|$|,)'", ['ATTENDEES_CODES'])
			->whereColumn('ID', 'PARENT_ID')
			//do subtract to make sampling more accurate
			->where('DATE_TO_TS_UTC', '>=', time() - CCalendar::GetDayLen())
		,
		'order' => [
			'ID' => 'ASC',
		],
	])->fetchAll();

	if (count($events) === 1)
	{
		$this->sendMessageToQueue($events[0]['ID']);
	}
	else
	{
		$this->sendBatchOfMessagesToQueue($events);
	}

	return self::ACK;
}

Добавить комментарий