• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/contactlist.php
  • Класс: Bitrix\Sender\ContactListTable
  • Вызов: ContactListTable::addIfNotExist
static function addIfNotExist($contactId, $listId)
{
	$result = false;
	$arPrimary = array('CONTACT_ID' => $contactId, 'LIST_ID' => $listId);
	if( !($arList = static::getRowById($arPrimary) ))
	{
		$resultAdd = static::add($arPrimary);
		if ($resultAdd->isSuccess())
		{
			$result = true;
		}
	}
	else
	{
		$result = true;
	}

	return $result;
}