if (!
$result &&
$this->failedWriteCommands
) { foreach ($this->failedWriteCommands
as $writeCommand) { if (!
$writeCommand instanceof WriteCommand
) { continue;
} $entityName =
$writeCommand->
getDefinition()->
getEntityName();
$entityResult =
$overallResults[$entityName] ??
$defaultTemplate;
$operation =
$writeCommand->
getEntityExistence()->
exists() ? EntityWriteResult::OPERATION_UPDATE
: EntityWriteResult::OPERATION_INSERT;
$type =
$writeCommand->
isFailed() ? 'Error' : 'Skip';
++
$entityResult[sprintf('%s%s',
$operation,
$type)];
$overallResults[$entityName] =
$entityResult;
} return $overallResults;
} if (!
$result || !
$result->
getEvents()) { return $overallResults;
}