if ($resolverContext instanceof EntityResolverContext &&
$resolverContext->
getDefinition() instanceof SalesChannelProductDefinition
) { $productConfig =
new FieldConfig('product', FieldConfig::SOURCE_MAPPED,
$resolverContext->
getEntity()->
get('id'
));
$config->
add($productConfig);
} $productConfig =
$config->
get('product'
);
if ($productConfig === null ||
$productConfig->
isMapped() ||
$productConfig->
getValue() === null
) { return null;
} $criteria =
$this->
createBestVariantCriteria($productConfig->
getStringValue());
$criteriaCollection =
new CriteriaCollection();
$criteriaCollection->
add('product_' .
$slot->
getUniqueIdentifier(), SalesChannelProductDefinition::
class,
$criteria);
return $criteriaCollection;
} abstract public function enrich(CmsSlotEntity
$slot, ResolverContext
$resolverContext, ElementDataCollection
$result): void;
protected function getSlotProduct(CmsSlotEntity
$slot, ElementDataCollection
$result, string
$productId): ?SalesChannelProductEntity
{