Acquia\Cloud\Api\CloudApiClient::moveDomain PHP Method

moveDomain() public method

Moves domains atomically from one environment to another.
See also: http://cloudapi.acquia.com/#POST__sites__site_domain_move__source__target-instance_route
public moveDomain ( string $site, string | array $domains, string $sourceEnv, string $targetEnv, boolean $skipSiteUpdate = FALSE ) : Acquia\Cloud\Api\Response\Task
$site string The site.
$domains string | array The domain name(s) as an array of strings, or the string '*' to move all domains.
$sourceEnv string The environment which currently has this domain.
$targetEnv string The destination environment for the domain.
$skipSiteUpdate boolean Optional. If set to TRUE this will inhibit running fields-config-web.php for this domain move.
return Acquia\Cloud\Api\Response\Task
    public function moveDomain($site, $domains, $sourceEnv, $targetEnv, $skipSiteUpdate = FALSE)
    {
        $paths = '{+base_path}/sites/{site}/domain-move/{source}/{target}.json';
        $update_site = '';
        if ($skipSiteUpdate) {
            $update_site = '1';
            $paths .= '?skip_site_update={update_site}';
        }
        $variables = array('site' => $site, 'source' => $sourceEnv, 'target' => $targetEnv, 'update_site' => $update_site);
        $body = Json::encode(array('domains' => (array) $domains));
        $request = $this->post(array($paths, $variables), null, $body);
        return new Response\Task($request);
    }