public function collect(CmsSlotEntity
$slot, ResolverContext
$resolverContext): ?CriteriaCollection
{ $config =
$slot->
getFieldConfig();
$collection =
new CriteriaCollection();
$products =
$config->
get('products'
);
if ($products === null
) { return null;
} if ($products->
isStatic() &&
$products->
getValue()) { $criteria =
new Criteria($products->
getArrayValue());
$criteria->
addAssociation('cover'
);
$criteria->
addAssociation('options.group'
);
$criteria->
addAssociation('manufacturer'
);
$collection->
add(self::STATIC_SEARCH_KEY . '_' .
$slot->
getUniqueIdentifier(), ProductDefinition::
class,
$criteria);
} if ($products->
isMapped() &&
$products->
getValue() &&
$resolverContext instanceof EntityResolverContext
) { $criteria =
$this->
collectByEntity($resolverContext,
$products);
if ($criteria !== null
) { $collection->
add(self::PRODUCT_SLIDER_ENTITY_FALLBACK . '_' .
$slot->
getUniqueIdentifier(), ProductDefinition::
class,
$criteria);
} }