• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/list.php
  • Класс: BitrixSenderListTable
  • Вызов: ListTable::addIfNotExist
static function addIfNotExist($code, $name)
{
	$id = false;
	if( !($arList = static::getList(array('filter' => array('CODE' => $code)))->fetch() ))
	{
		$resultAdd = static::add(array('CODE' => $code, 'NAME' => $name));
		if ($resultAdd->isSuccess())
		{
			$id = $resultAdd->getId();
		}
	}
	else
	{
		$id = $arList['ID'];
	}

	return $id;
}