• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/timeline/icon.php
  • Класс: Bitrix\Crm\Controller\Timeline\Icon
  • Вызов: Icon::deleteAction
public function deleteAction(string $code): ?bool
{
	if (!$this->isAdmin())
	{
		$this->addError(ErrorCode::getAccessDeniedError());

		return null;
	}

	$icon = $this->getIcon($code);

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

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

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

	return null;
}