• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/v2/Property/PropertyRepository.php
  • Класс: BitrixCatalogv2PropertyPropertyRepository
  • Вызов: PropertyRepository::getLinkedPropertyIds
protected function getLinkedPropertyIds(int $iblockId, HasSectionCollection $parent): array
{
	$linkedPropertyIds = [$this->loadPropertyIdsWithoutAnyLink($iblockId)];

	if ($parent->getSectionCollection()->isEmpty())
	{
		$linkedPropertyIds[] = array_keys(CIBlockSectionPropertyLink::getArray($iblockId));
	}

	/** @var BitrixCatalogv2SectionSection $section */
	foreach ($parent->getSectionCollection() as $section)
	{
		$linkedPropertyIds[] = array_keys(CIBlockSectionPropertyLink::getArray($iblockId, $section->getValue()));
	}

	if (!empty($linkedPropertyIds))
	{
		$linkedPropertyIds = array_merge(...$linkedPropertyIds);
		Collection::normalizeArrayValuesByInt($linkedPropertyIds, false);
		$linkedPropertyIds = array_unique($linkedPropertyIds);
	}

	return $linkedPropertyIds;
}