• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/util.php
  • Класс: BitrixCalendarUtil
  • Вызов: Util::convertEntitiesToCodes
static function convertEntitiesToCodes($entityList = [])
{
	$codeList = [];
	if (is_array($entityList))
	{
		foreach($entityList as $entity)
		{
			if ($entity['entityId'] === 'meta-user' && $entity['id'] === 'all-users')
			{
				$codeList[] = 'UA';
			}
			elseif ($entity['entityId'] === 'user')
			{
				$codeList[] = 'U'.$entity['id'];
			}
			elseif ($entity['entityId'] === 'project' || $entity['entityId'] === 'project-roles')
			{
				$codeList[] = 'SG'.$entity['id'];
			}
			elseif ($entity['entityId'] === 'department')
			{
				$codeList[] = 'DR'.$entity['id'];
			}
		}
	}
	return $codeList;
}