• Модуль: catalogmobile
  • Путь к файлу: ~/bitrix/modules/catalogmobile/lib/Controller/StoreDocumentDetails.php
  • Класс: Bitrix\CatalogMobile\Controller\StoreDocumentDetails
  • Вызов: StoreDocumentDetails::cancelAction
public function cancelAction(int $entityId): ?array
{
	if (!$this->checkDocumentCancelRights($entityId))
	{
		$this->addError(new Error(Loc::getMessage('MOBILE_CONTROLLER_CATALOG_DETAILS_ERROR_CANCELLATION_PERMS')));

		return null;
	}

	if (!$entityId)
	{
		$this->addError(new Error(Loc::getMessage('MOBILE_CONTROLLER_CATALOG_DETAILS_ERROR_NOT_FOUND')));

		return null;
	}

	$result = \CCatalogDocs::cancellationDocument($entityId, $this->getCurrentUser()->getId());
	if (!$result)
	{
		$this->addError(
			$this->getLastApplicationError()
				?: new Error(Loc::getMessage('MOBILE_CONTROLLER_CATALOG_DETAILS_ERROR_CANCELLATION'))
		);

		return null;
	}

	return [
		'load' => $this->createLoadResponse(),
	];
}