• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/merger/conflictresolver/namefield.php
  • Класс: Bitrix\Crm\Merger\ConflictResolver\NameField
  • Вызов: NameField::checkRedundantSpacesInAllFields
protected function checkRedundantSpacesInAllFields(
	string $seedNameValue,
	string $seedLastNameValue,
	string $targetNameValue,
	string $targetLastNameValue
): bool
{
	$seedNameValueWithoutSpaces = $this->removeSpaces($seedNameValue);
	$seedLastNameValueWithoutSpaces = $this->removeSpaces($seedLastNameValue);
	$targetNameValueWithoutSpaces = $this->removeSpaces($targetNameValue);
	$targetLastNameValueWithoutSpaces = $this->removeSpaces($targetLastNameValue);

	if(
		$seedNameValueWithoutSpaces === $targetNameValueWithoutSpaces
		&& $seedLastNameValueWithoutSpaces === $targetLastNameValueWithoutSpaces
	)
	{
		if($targetLastNameValue !== $targetLastNameValueWithoutSpaces)
		{
			$this->setNewTargetValue($targetNameValue);
			$this->setNewTargetValue($targetLastNameValueWithoutSpaces, 'LAST_NAME');
		}
		if($targetNameValue !== $targetNameValueWithoutSpaces)
		{
			$this->setNewTargetValue($targetNameValueWithoutSpaces);
		}

		
		return true;
	}
	
	return false;
}