• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/merger/requisitemerginghelper.php
  • Класс: Bitrix\Crm\Merger\RequisiteMergingHelper
  • Вызов: RequisiteMergingHelper::isBankDetailNoConflicts
protected function isBankDetailNoConflicts(array $targBankDetail, array $seedBankDetail)
{
	$result = false;
	$seedCountryId = isset($seedBankDetail['COUNTRY_ID']) ? (int)$seedBankDetail['COUNTRY_ID'] : 0;
	$targCountryId = isset($targBankDetail['COUNTRY_ID']) ? (int)$targBankDetail['COUNTRY_ID'] : 0;

	if ($seedCountryId > 0 && $seedCountryId === $targCountryId)
	{
		$countryId = $seedCountryId;

		if (is_array($this->bankDetailFieldsMap[$countryId]) && !empty($this->bankDetailFieldsMap[$countryId]))
		{
			$result = true;
			foreach ($this->bankDetailFieldsMap[$countryId] as $fieldName)
			{
				$seedValue = isset($seedBankDetail[$fieldName]) ? $seedBankDetail[$fieldName] : null;
				$targValue = isset($targBankDetail[$fieldName]) ? $targBankDetail[$fieldName] : null;
				$isSeedValueEmpty = ($seedValue === null
					|| (is_string($seedValue) ? $seedValue == '' : empty($seedValue)));
				$isTargValueEmpty = ($targValue === null
					|| (is_string($targValue) ? $targValue == '' : empty($targValue)));
				if (!$isSeedValueEmpty && !$isTargValueEmpty && $seedValue != $targValue)
				{
					$result = false;
					break;
				}
			}
		}
	}

	return $result;
}