'versionId' => Uuid::
fromHexToBytes($context->
getVersionId()),
];
$products =
$this->connection->
fetchAllAssociative( $sql,
$params,
['ids' => ArrayParameterType::STRING
] );
$updates =
[];
foreach ($products as $product) { $newStates =
$this->
getNewStates($product);
$oldStates =
$product['states'
] ?
json_decode((string) $product['states'
], true, 512, \JSON_THROW_ON_ERROR
) :
[];
if (\
count(array_diff($newStates,
$oldStates)) === 0
) { continue;
} $updates[] =
new UpdatedStates($product['id'
],
$oldStates,
$newStates);
} if (empty($updates)) { return;
}