- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/exclusion/store.php
- Класс: Bitrix\Crm\Exclusion\Store
- Вызов: Store::add
static function add($typeId, $code, $comment = null)
{
if (self::has($typeId, $code))
{
return null;
}
try
{
return ExclusionTable::add(array(
'TYPE_ID' => $typeId,
'CODE' => Communication\Normalizer::normalize($code, $typeId),
'COMMENT' => $comment,
))->getId();
}
catch (SqlQueryException $exception)
{
if (mb_strpos($exception->getDatabaseMessage(), '(1062)') === false)
{
throw $exception;
}
}
return null;
}