EntityBankDetail::delete

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityBankDetail
  4. delete
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entitybankdetail.php
  • Класс: Bitrix\Crm\EntityBankDetail
  • Вызов: EntityBankDetail::delete
public function delete($id, $options = array())
{
	$entityInfo = array(
		'ENTITY_TYPE_ID' => CCrmOwnerType::Undefined,
		'ENTITY_ID' => 0
	);
	$parentInfo = self::getOwnerEntityById($id);
	if ($parentInfo['ENTITY_TYPE_ID'] === CCrmOwnerType::Requisite)
		$entityInfo = EntityRequisite::getOwnerEntityById($parentInfo['ENTITY_ID']);
	unset($parentInfo);

	$result = BankDetailTable::delete($id);
	if ($result->isSuccess()
		&& CCrmOwnerType::IsDefined($entityInfo['ENTITY_TYPE_ID']) && $entityInfo['ENTITY_ID'] > 0)
	{
		DuplicateBankDetailCriterion::registerByEntity($entityInfo['ENTITY_TYPE_ID'], $entityInfo['ENTITY_ID']);

		//region Register volatile duplicate criterion fields
		DuplicateVolatileCriterion::register(
			$entityInfo['ENTITY_TYPE_ID'],
			$entityInfo['ENTITY_ID'],
			[FieldCategory::BANK_DETAIL]
		);
		//endregion Register volatile duplicate criterion fields
	}

	//region Send event
	if ($result->isSuccess())
	{
		$event = new Main\Event('crm', 'OnAfterBankDetailDelete', array('id' => $id));
		$event->send();
	}
	//endregion Send event

	return $result;
}

Добавить комментарий