You are here

protected function Fastly::getActiveVersion in Fastly 7

Same name and namespace in other branches
  1. 7.2 fastly.api.inc \Fastly::getActiveVersion()

Gets active version number for the current service.

2 calls to Fastly::getActiveVersion()
Fastly::getSettings in ./fastly.api.inc
Gets the settings for a version.
Fastly::updateSettings in ./fastly.api.inc
Updates the settings for a version.

File

./fastly.api.inc, line 153
Contains Faslt class that handles API calls to the Fastly service.

Class

Fastly
Fastly API for Drupal.

Code

protected function getActiveVersion() {
  $service = json_decode($this
    ->query('service/' . $this->service_id)->data);
  foreach ($service->versions as $version) {
    if ($version->active) {
      return $version->number;
    }
  }
}