...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/controller/activity/badge.php
- Класс: Bitrix\Crm\Controller\Activity\Badge
- Вызов: Badge::addAction
public function addAction(string $code, $title, $value, string $type): ?array { if (!$this->isAdmin()) { $this->addError(ErrorCode::getAccessDeniedError()); return null; } $this->validateTranslatedText($title, 'title'); $this->validateTranslatedText($value, 'value'); $this->validateType($type); if (!empty($this->getErrors())) { return null; } $result = $this->badgeTable::add([ 'CODE' => $code, 'TITLE' => $title, 'VALUE' => $value, 'TYPE' => $type, ]); if ($result->isSuccess()) { return [ 'badge' => $this->getBadge($code), ]; } foreach ($result->getErrors() as $error) { $this->addError($error); } return null; }