/**
  * Helper function to get the latest database backup.
  *
  * @param string $site_name
  *   The machine name of the Site in question.
  * @param string $env_name
  *   The machine name of the Site Environment in question.
  * @param string $backup_type
  *   The type of backup.
  *
  * @return array
  *   A backup array as defined in apiGetSiteEnvBackups().
  */
 public function getSiteEnvBackupLatest($site_name, $env_name, $backup_type)
 {
     $backup = parent::getSiteEnvBackupLatest($site_name, $env_name, $backup_type);
     if ($backup_type == 'db') {
         $backup['url'] = $this->apiGetBackupDownloadUrl($site_name, $env_name, $backup['bucket'], 'database');
     }
     unset($backup['bucket']);
     return $backup;
 }
 /**
  * Helper function to get the latest database backup.
  *
  * @param string $site_name
  *   The machine name of the Site in question.
  * @param string $env_name
  *   The machine name of the Site Environment in question.
  * @param string $backup_type
  *   The type of backup.
  *
  * @return array
  *   A backup array as defined in apiGetSiteEnvBackups().
  */
 public function getSiteEnvBackupLatest($site_name, $env_name, $backup_type)
 {
     $site = SiteQuery::create()->filterByProvider($this->name)->filterByName($site_name)->findOne();
     $backup = parent::getSiteEnvBackupLatest($site_name, $env_name, $backup_type);
     if ($backup_type == 'db') {
         $backup['url'] = 'https://cloudapi.acquia.com/v1/sites/' . $site->getRealm() . ':' . $site_name . '/envs/' . $env_name . '/dbs/' . $site_name . '/backups/' . $backup['id'] . '/download.json';
     }
     unset($backup['id']);
     return $backup;
 }