$cheapestPrice =
new RetryableQuery( $this->connection,
$this->connection->
prepare('UPDATE product SET cheapest_price = :price WHERE id = :id AND version_id = :version'
) );
$accessorQuery =
new RetryableQuery( $this->connection,
$this->connection->
prepare('UPDATE product SET cheapest_price_accessor = :accessor WHERE id = :id AND version_id = :version'
) );
foreach ($all as $productId =>
$prices) { $container =
new CheapestPriceContainer($prices);
$cheapestPrice->
execute([ 'price' =>
serialize($container),
'id' => Uuid::
fromHexToBytes($productId),
'version' =>
$versionId,
]);
$variantIds =
$container->
getVariantIds();
if (!
$variantIds) { continue;
}