• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/watcher/membership/handler/department.php
  • Класс: BitrixCalendarWatcherMembershipHandlerDepartment
  • Вызов: Department::onBeforeIBlockSectionUpdate
static function onBeforeIBlockSectionUpdate($arFields): void
{
	if (
		empty($arFields['ID'])
		||empty($arFields['IBLOCK_ID'])
		|| empty($arFields['IBLOCK_SECTION_ID'])
		|| !Loader::includeModule("iblock")
		|| !self::isDepartmentIBlock($arFields['IBLOCK_ID'])
	)
	{
		return;
	}

	$updatingDepartment = CIBlockSection::GetByID($arFields['ID'])->Fetch();
	if (($arFields['IBLOCK_SECTION_ID']) === $updatingDepartment['IBLOCK_SECTION_ID'])
	{
		return;
	}

	$departments = array_unique(
		array_merge(
			[$arFields['IBLOCK_SECTION_ID']],
			[$updatingDepartment['IBLOCK_SECTION_ID']],
		)
	);

	self::$storedData = self::getAffectedDepartments($departments, $arFields['IBLOCK_ID']);
}