You are here

public function AkamaiClientFactory::get in Akamai 8.3

Constructs a new AkamaiClient object.

Normally, the version set as the default in the admin UI is used by the factory to create new AkamaiClient objects. This can be overridden through \Drupal\akamai\AkamaiClientInterface::setclientVersion() so that any new AkamaiClient object created will use the new version specified. Finally, a single AkamaiClient object can be created using a specific version, regardless of the current factory settings, by passing its plugin ID in the $client_version argument.

Parameters

string|null $client_version: (optional) The version of the akamai client to use for this object, or NULL to use the current version.

Return value

\Drupal\akamai\AkamaiClientInterface An Akamai Client object.

See also

AkamaiClientFactory::setclientVersion()

File

src/AkamaiClientFactory.php, line 78

Class

AkamaiClientFactory
Provides a factory for Akamai client objects.

Namespace

Drupal\akamai

Code

public function get($client_version = NULL) {
  $client_version = $client_version ?: $this->clientVersion;
  return $this->clientManager
    ->createInstance($client_version);
}