php-docs-samples
php-docs-samples copied to clipboard
Spanner: Create Backup sample should have latest timestamp as a default.
Currently, we can pass now for the parameter $versionTime to achieve the backup until the current timestamp. The simplest way to make it default can be to use the string now as a default for $versionTime.
This however still means that we pass a DateTime object to Spanner. Perhaps we can also use null as a default, in which case we don't pass the versionTime parameter to the $backup->create() method, thereby letting Spanner take the call which will be equivalent to unchecking Create backup from an earlier point in time in the Cloud Console UI.