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

	/** @var VolumeIClearConstraint[] $clearConstraintList */
	static $clearConstraintList;
	if (empty($clearConstraintList))
	{
		$clearConstraintList = [];

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

	if ($storage instanceof DiskStorage)
	{
		/** @var VolumeIClearConstraint $indicator */
		foreach ($clearConstraintList as $indicatorId => $indicator)
		{
			if (!$indicator->isAllowClearStorage($storage))
			{
				$allowClear = false;
			}
		}
	}

	return $allowClear;
}