• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/commonactions.php
  • Класс: BitrixDiskControllerCommonActions
  • Вызов: CommonActions::restoreCollectionAction
public function restoreCollectionAction(DiskTypeObjectCollection $objectCollection)
{
	$restoredIds = [];
	$currentUserId = $this->getCurrentUser()->getId();
	foreach ($objectCollection as $object)
	{
		/** @var DiskBaseObject $object */
		$securityContext = $object->getStorage()->getSecurityContext($currentUserId);
		if ($object->canRestore($securityContext))
		{
			if (!$object->restore($currentUserId))
			{
				$this->errorCollection->add($object->getErrors());
				continue;
			}

			$restoredIds[] = $object->getRealObjectId();
		}
	}

	return [
		'restoredObjectIds' => $restoredIds,
	];
}