You are here

public function AkamaiClientBase::setDomain in Akamai 8.3

Sets the domain to clear.

Parameters

string $domain: The domain to clear, either 'production' or 'staging'.

Return value

$this

Overrides AkamaiClientInterface::setDomain

File

src/AkamaiClientBase.php, line 402

Class

AkamaiClientBase
Connects to the Akamai EdgeGrid.

Namespace

Drupal\akamai

Code

public function setDomain($domain) {
  $valid_domains = [
    'staging',
    'production',
  ];
  if (in_array($domain, $valid_domains)) {
    $this->domain = $domain;
  }
  else {
    throw new \InvalidArgumentException('Domain must be one of: ' . implode(', ', $valid_domains));
  }
  return $this;
}