• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/repository/schedule/schedulerepository.php
  • Класс: BitrixTimemanRepositoryScheduleScheduleRepository
  • Вызов: ScheduleRepository::findAllNestedDepartmentsIds
public function findAllNestedDepartmentsIds($departmentsIds)
{
	if (!is_array($departmentsIds))
	{
		$departmentsIds = [$departmentsIds];
	}
	$subResults = [];
	foreach ($departmentsIds as $departmentId)
	{
		$subDepartmentsNested = CIntranetUtils::getSubDepartments($departmentId);
		if (!empty($subDepartmentsNested))
		{
			$subResults = array_merge($subResults, $subDepartmentsNested, $this->findAllNestedDepartmentsIds($subDepartmentsNested));
		}
	}
	return array_unique($subResults);
}