\
assert(\
is_string($customerId));
$customerIdsWithReviews[$customerId] = true;
$payload[] =
[ 'id' => Uuid::
randomHex(),
'productId' =>
$context->
getFaker()->
randomElement($productIds),
'customerId' =>
$customerId,
'salesChannelId' =>
$salesChannelIds[array_rand($salesChannelIds)],
'languageId' => Defaults::LANGUAGE_SYSTEM,
'externalUser' =>
$context->
getFaker()->
name(),
'externalEmail' =>
$context->
getFaker()->
email(),
'title' =>
$context->
getFaker()->
sentence(),
'content' =>
$context->
getFaker()->
text(),
'points' =>
$context->
getFaker()->
randomElement($points),
'status' =>
(bool) random_int(0, 1
),
];
if (\
count($payload) >= 100
) { $this->writer->
upsert($this->productReviewDefinition,
$payload,
$writeContext);
$context->
getConsole()->
progressAdvance(\
count($payload));
$payload =
[];
}