You are here

public function Zone::getZoneSettings in CloudFlare 8

Gets the zone's settings from CloudFlare's API.

Return value

\CloudFlarePhpSdk\ApiTypes\Zone\ZoneSettings|null Zone settings retrieved from the CloudFlareAPI. NULL if unable to retrieve.

Overrides CloudFlareZoneInterface::getZoneSettings

File

src/Zone.php, line 135

Class

Zone
Zone methods for CloudFlare.

Namespace

Drupal\cloudflare

Code

public function getZoneSettings() {
  $this->cloudFlareComposerDependenciesCheck
    ->assert();
  if (!$this->validCredentials) {
    return NULL;
  }
  try {
    $settings = $this->zoneApi
      ->getZoneSettings($this->zone);
    $this->state
      ->incrementApiRateCount();
    return $settings;
  } catch (CloudFlareException $e) {
    $this->logger
      ->error($e
      ->getMessage());
    throw $e;
  }
}