Badge::deleteAction

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Badge
  4. deleteAction
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/activity/badge.php
  • Класс: Bitrix\Crm\Controller\Activity\Badge
  • Вызов: Badge::deleteAction
public function deleteAction(string $code): ?bool
{
	if (!$this->isAdmin())
	{
		$this->addError(ErrorCode::getAccessDeniedError());

		return null;
	}

	$badge = $this->getBadge($code);

	if (!$badge)
	{
		$this->addError(new Error("Badge not found for code `$code`", ErrorCode::NOT_FOUND));
		return null;
	}

	$result = $this->delete($badge);
	if ($result->isSuccess())
	{
		return true;
	}

	foreach ($result->getErrors() as $error)
	{
		$this->addError($error);
	}

	return null;
}

Добавить комментарий