/** * Magic __get, overriding Persistent. * * @param string $name * Name of the property. * * @return mixed * Value of set property. * @throws \Exception */ public function apiGetField($name) { $callers = debug_backtrace(); drush_log(dt('Site @site_name is missing value for @name from @calling_function.', array('@site_name' => $this->name, '@name' => $name, '@calling_function' => $callers[1]['function']))); $provider = Switchboard\Provider::getInstance($this->getProvider()); $provider->siteGetField($this->getName(), $name); }
/** * 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; }