private readonly EntityRepository
$repository ) { } public function getType(): string
{ return 'buy-box';
} public function enrich(CmsSlotEntity
$slot, ResolverContext
$resolverContext, ElementDataCollection
$result): void
{ $buyBox =
new BuyBoxStruct();
$slot->
setData($buyBox);
$productConfig =
$slot->
getFieldConfig()->
get('product'
);
if ($productConfig === null
) { return;
} $product = null;
if ($productConfig->
isMapped() &&
$resolverContext instanceof EntityResolverContext
) { $product =
$this->
resolveEntityValue($resolverContext->
getEntity(),
$productConfig->
getStringValue());
}