• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/posting.php
  • Класс: BitrixSenderPostingTable
  • Вызов: PostingTable::addRecipient
static function addRecipient($ar, $checkDuplicate = false)
{
	if(!$checkDuplicate)
	{
		$needAdd = true;
	}
	else
	{
		$row = PostingRecipientTable::getRow(array(
			'select' => array('ID'),
			'filter' => array(
				'=CONTACT_ID' => $ar['CONTACT_ID'],
				'=POSTING_ID' => $ar['POSTING_ID']
			)
		));
		if(!$row)
		{
			$needAdd = true;
		}
		else
		{
			$needAdd = false;
		}
	}

	if($needAdd)
	{
		PostingRecipientTable::add($ar);
	}
}