• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/binding/map/mapsection.php
  • Класс: BitrixIntranetBindingMapMapSection
  • Вызов: MapSection::isEqualTo
public function isEqualTo(self $anotherSection): bool
{
	if ($this->getScope() !== $anotherSection->getScope())
	{
		return false;
	}

	if ($this->getCode() !== $anotherSection->getCode())
	{
		return false;
	}

	// another section should have all items of this section
	foreach ($this->getItems() as $itemOfThisSection)
	{
		if (!$anotherSection->hasByCode($itemOfThisSection->getCode()))
		{
			return false;
		}
	}

	// this section should have all items of another section
	foreach ($anotherSection->getItems() as $itemOfAnotherSection)
	{
		if (!$this->hasByCode($itemOfAnotherSection->getCode()))
		{
			return false;
		}
	}

	return true;
}