• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/utils.php
  • Класс: CIntranetUtils
  • Вызов: CIntranetUtils::GetUserDepartments
static function GetUserDepartments($USER_ID)
{
	static $cache = array();
	$USER_ID = intval($USER_ID);
	if (!isset($cache[$USER_ID]))
	{
		$dbRes = CUser::GetList(
			'ID', 'ASC',
			array('ID' => $USER_ID),
			array('SELECT' => array('UF_DEPARTMENT'), 'FIELDS' => array('ID'))
		);
		$arRes = $dbRes->Fetch();
		if ($arRes)
		{
			$cache[$USER_ID] = $arRes['UF_DEPARTMENT'];
		}
	}

	return $cache[$USER_ID];
}