Manager::getRoomsAccess

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. Manager
  4. getRoomsAccess
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/rooms/manager.php
  • Класс: BitrixCalendarRoomsManager
  • Вызов: Manager::getRoomsAccess
static function getRoomsAccess(array $roomsId, array $rooms): array
{
	if (empty($roomsId))
	{
		return [];
	}

	$accessQuery = AccessTable::query()
		->setSelect([
			'ACCESS_CODE',
			'TASK_ID',
			'SECT_ID'
		])
		->whereIn('SECT_ID', $roomsId)
		->exec()
	;

	while ($access = $accessQuery->fetch())
	{
		if (!isset($rooms[$access['SECT_ID']]['ACCESS']))
		{
			$rooms[$access['SECT_ID']]['ACCESS'] = [];
		}
		$rooms[$access['SECT_ID']]['ACCESS'][$access['ACCESS_CODE']] = (int)$access['TASK_ID'];
	}

	return $rooms;
}

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