• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/volume/cleaner.php
  • Класс: BitrixDiskVolumeCleaner
  • Вызов: Cleaner::isAllowDeleteFolder
public function isAllowDeleteFolder(DiskFolder $folder): bool
{
	$allowDrop = true;

	if ($folder->isDeleted())
	{
		return true;
	}

	/** @var VolumeIDeleteConstraint[] $deleteConstraintList */
	static $deleteConstraintList;
	if (empty($deleteConstraintList))
	{
		$deleteConstraintList = [];

		// full list available indicators
		$constraintIdList = VolumeBase::listDeleteConstraint();
		foreach ($constraintIdList as $indicatorId => $indicatorIdClass)
		{
			$deleteConstraintList[$indicatorId] = new $indicatorIdClass();
		}
	}

	/** @var VolumeIDeleteConstraint $indicator */
	foreach ($deleteConstraintList as $indicatorId => $indicator)
	{
		if (!$indicator->isAllowDeleteFolder($folder))
		{
			$allowDrop = false;
		}
	}

	return $allowDrop;
}