• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/entity/contact.php
  • Класс: BitrixSenderEntityContact
  • Вызов: Contact::saveData
protected function saveData($id, array $data)
{
	$setList = array_filter($data['SET_LIST'], 'is_numeric');
	$subList = array_filter($data['SUB_LIST'], 'is_numeric');
	$unsubList = array_filter($data['UNSUB_LIST'], 'is_numeric');

	$this->filterDataByEntityFields(ContactTable::getEntity(), $data);

	try
	{
		$id = $this->saveByEntity(ContactTable::getEntity(), $id, $data);
	}
	catch (SqlQueryException $exception)
	{
		if (mb_strpos($exception->getMessage(), '(1062) Duplicate entry') !== false)
		{
			$this->errors->setError(new Error(Loc::getMessage('SENDER_ENTITY_CONTACT_ERROR_DUPLICATE')));
			return $id;
		}

		throw $exception;
	}

	if ($this->hasErrors())
	{
		return $id;
	}

	$this->saveDataLists($id, $setList, $subList, $unsubList);

	return $id;
}