CodeExplorer getAreaRuleIds example
$idD = Uuid::
randomHex();
$areaRuleIds =
[ 'a' =>
[$idA,
$idB],
'b' =>
[$idA,
$idC,
$idD],
'c' =>
[$idB],
'd' =>
[$idC],
];
$salesChannelContext->
setAreaRuleIds($areaRuleIds);
static::
assertEquals($areaRuleIds,
$salesChannelContext->
getAreaRuleIds());
static::
assertEquals([$idA,
$idB],
$salesChannelContext->
getRuleIdsByAreas(['a'
]));
static::
assertEquals([$idA,
$idB,
$idC,
$idD],
$salesChannelContext->
getRuleIdsByAreas(['a', 'b'
]));
static::
assertEquals([$idA,
$idB],
$salesChannelContext->
getRuleIdsByAreas(['a', 'c'
]));
static::
assertEquals([$idC],
$salesChannelContext->
getRuleIdsByAreas(['d'
]));
static::
assertEquals([],
$salesChannelContext->
getRuleIdsByAreas(['f'
]));
} private function getSalesChannelContext(): SalesChannelContext
{ return new SalesChannelContext(