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

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

	/** @var VolumeIClearFolderConstraint[] $clearFolderConstraintList */
	static $clearFolderConstraintList;
	if (empty($clearFolderConstraintList))
	{
		$clearFolderConstraintList = [];

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

	/** @var VolumeIClearFolderConstraint $indicator */
	foreach ($clearFolderConstraintList as $indicatorId => $indicator)
	{
		if (!$indicator->isAllowClearFolder($folder))
		{
			$allowClear = false;
		}
	}

	return $allowClear;
}