$sourceEntity = ProductDefinition::ENTITY_NAME;
$config =
new Config([],
['sourceEntity' =>
$sourceEntity],
[]);
$id = Uuid::
randomHex();
$product =
(new ProductEntity())->
assign([ 'id' =>
$id,
'stock' => 101,
'productNumber' => 'P101',
'active' => true,
'translations' =>
new ProductTranslationCollection([ (new ProductTranslationEntity())->
assign([ 'languageId' => Defaults::LANGUAGE_SYSTEM,
'name' => 'test product',
'_uniqueIdentifier' =>
$id . '_' . Defaults::LANGUAGE_SYSTEM,
]),
]),
]);
$product->
setUniqueIdentifier($id);
$result =
iterator_to_array($entityPipe->
in($config,
$product->
jsonSerialize()));