• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/entitypropertyvalue.php
  • Класс: BitrixSaleEntityPropertyValue
  • Вызов: EntityPropertyValue::constructPropertyRelatedEntitiesFilter
static function constructPropertyRelatedEntitiesFilter(Entity $entity): array
{
	$result = [];

	$psFilter = ['=RELATION_PS.ENTITY_ID' => null];

	if ($paySystemList = static::extractPaySystemIdList($entity))
	{
		$psFilter['LOGIC'] = 'OR';
		$psFilter['@RELATION_PS.ENTITY_ID'] = $paySystemList;
	}

	$result[] = $psFilter;
	$dlvFilter = ['=RELATION_DLV.ENTITY_ID' => null];

	if ($deliveryList = static::extractDeliveryIdList($entity))
	{
		$dlvFilter['LOGIC'] = 'OR';
		$dlvFilter['@RELATION_DLV.ENTITY_ID'] = $deliveryList;
	}

	$result[] = $dlvFilter;

	if (self::hasPresetForLanding($entity))
	{
		$result[] = [
			'LOGIC' => 'OR',
			'!RELATION_PS.ENTITY_ID' => null,
			'!RELATION_DLV.ENTITY_ID' => null,
		];

		$result = [
			'LOGIC' => 'OR',
			'@RELATION_TP_LANDING.ENTITY_ID' => static::extractTpLandingIdList($entity),
			$result,
		];
	}
	else
	{
		$result = [
			'=RELATION_TP_LANDING.ENTITY_ID' => null,
			$result,
		];
	}

	if (self::hasPresetFotTradingPlatform($entity))
	{
		$result[] = [
			'LOGIC' => 'OR',
			'!RELATION_PS.ENTITY_ID' => null,
			'!RELATION_DLV.ENTITY_ID' => null,
			'!RELATION_TP_LANDING.ENTITY_ID' => null,
		];

		$result = [
			'LOGIC' => 'OR',
			'@RELATION_TP.ENTITY_ID' => static::extractTradingPlatformIdList($entity),
			$result,
		];
	}
	else
	{
		$result = [
			'=RELATION_TP.ENTITY_ID' => null,
			$result,
		];
	}

	return $result;
}