You are here

public function AkamaiClientBase::setType in Akamai 8.3

Sets the type of purge.

Parameters

string $type: The type of purge, either 'arl' or 'cpcode'.

Return value

$this

Overrides AkamaiClientInterface::setType

1 method overrides AkamaiClientBase::setType()
AkamaiClientV3::setType in src/Plugin/Client/AkamaiClientV3.php
Sets the type of purge.

File

src/AkamaiClientBase.php, line 364

Class

AkamaiClientBase
Connects to the Akamai EdgeGrid.

Namespace

Drupal\akamai

Code

public function setType($type) {
  $valid_types = [
    'cpcode',
    'arl',
  ];
  if (in_array($type, $valid_types)) {
    $this->type = $type;
  }
  else {
    throw new \InvalidArgumentException('Type must be one of: ' . implode(', ', $valid_types));
  }
  return $this;
}