$primaryKeys =
$definition->
getPrimaryKeys() ->
filter(static fn (Field
$field) => !
$field instanceof VersionField && !
$field instanceof ReferenceVersionField
);
$identifiers[$definition->
getEntityName()] =
[];
$jsonUpdateCommands =
[];
$writeResults =
[];
foreach ($commands as $command) { $primaryKey =
$this->
getCommandPrimaryKey($command,
$primaryKeys);
$uniqueId = \
is_array($primaryKey) ?
implode('-',
$primaryKey) :
$primaryKey;
if ($command instanceof JsonUpdateCommand
) { $jsonUpdateCommands[$uniqueId] =
$command;
continue;
} $operation = EntityWriteResult::OPERATION_UPDATE;
if ($command instanceof InsertCommand
) { $operation = EntityWriteResult::OPERATION_INSERT;
}