EventAccessController::loadItem

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. EventAccessController
  4. loadItem
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/access/eventaccesscontroller.php
  • Класс: BitrixCalendarAccessEventAccessController
  • Вызов: EventAccessController::loadItem
protected function loadItem(int $itemId = null): ?AccessibleItem
{
	$key = self::ITEM_TYPE . '_' . $itemId;
	if (!array_key_exists($key, static::$cache))
	{
		/**@var  BitrixCalendarCoreEventEvent $event */
		$event = (new Event())->getById($itemId);

		if ($event instanceof BitrixCalendarCoreEventEvent)
		{
			$eventModel = EventModel::createFromObject($event);
		}
		else
		{
			$eventModel = EventModel::createNew();
		}

		static::$cache[$key] = $eventModel;
	}

	return static::$cache[$key];
}

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