• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Multifield/Collection.php
  • Класс: Bitrix\Crm\Multifield\Collection
  • Вызов: Collection::isEqualTo
public function isEqualTo(self $anotherCollection): bool
{
	$thisValues = $this->getAll();
	$anotherValues = $anotherCollection->getAll();

	if (count($thisValues) !== count($anotherValues))
	{
		return false;
	}

	$thisHashes = [];
	foreach ($thisValues as $thisValue)
	{
		$thisHashes[] = $thisValue->getHash();
	}
	sort($thisHashes);

	$anotherHashes = [];
	foreach ($anotherValues as $anotherValue)
	{
		$anotherHashes[] = $anotherValue->getHash();
	}
	sort($anotherHashes);

	return ($thisHashes === $anotherHashes);
}