You are here

public function WSServer::isDisabled in Web Service Data 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/WSServer.php \Drupal\wsdata\Entity\WSServer::isDisabled()

Check if wsserver is disabled.

Overrides WSServerInterface::isDisabled

File

src/Entity/WSServer.php, line 173

Class

WSServer
Defines the Web Service Server entity.

Namespace

Drupal\wsdata\Entity

Code

public function isDisabled() {
  if (!isset($this->state['degraded_backoff'])) {
    $this->state['degraded_backoff'] = wsserver::$WSCONFIG_DEFAULT_DEGRADED_BACKOFF;
  }
  if (isset($this->state['degraded']) and $this->state['degraded'] < time() - $this->state['degraded_backoff']) {
    $this
      ->enable(TRUE);
    return FALSE;
  }
  return isset($this->state['disabled']) ? $this->state['disabled'] : FALSE;
}