• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_event.php
  • Класс: CCalendarEvent
  • Вызов: CCalendarEvent::checkAttendeeBelongsToEvent
static function checkAttendeeBelongsToEvent($eventId, $userId)
{
	if (empty($eventId) || empty($userId))
	{
		return false;
	}

	if (isset(self::$attendeeBelongingToEvent[$eventId][$userId]))
	{
		return self::$attendeeBelongingToEvent[$eventId][$userId];
	}

	$event = InternalsEventTable::query()
		->setSelect(['ID'])
		->where('PARENT_ID', $eventId)
		->where('OWNER_ID', $userId)
		->exec()->fetch()
	;

	if (!isset(self::$attendeeBelongingToEvent[$eventId]))
	{
		self::$attendeeBelongingToEvent[$eventId] = [];
	}
	if (!isset(self::$attendeeBelongingToEvent[$eventId][$userId]))
	{
		self::$attendeeBelongingToEvent[$eventId][$userId] = !empty($event);
	}

	return self::$attendeeBelongingToEvent[$eventId][$userId];
}