public function WSServer::disable in Web Service Data 8
Same name and namespace in other branches
- 2.0.x src/Entity/WSServer.php \Drupal\wsdata\Entity\WSServer::disable()
 
Disables the configuration entity.
Return value
$this
Overrides ConfigEntityBase::disable
File
- src/
Entity/ WSServer.php, line 136  
Class
- WSServer
 - Defines the Web Service Server entity.
 
Namespace
Drupal\wsdata\EntityCode
public function disable($degraded = FALSE) {
  $reason = '';
  if ($degraded) {
    if (!isset($this->state['degraded_backoff'])) {
      $this->state['degraded_backoff'] = wsserver::$WSCONFIG_DEFAULT_DEGRADED_BACKOFF;
    }
    if ($this->state['degraded_backoff'] == 0) {
      return;
    }
    $reason = '  ' . t('Automatically disabled due to degrated service.');
    $this->state['degraded'] = time();
  }
  $this->state['disabled'] = TRUE;
  \Drupal::logger('wsdata')
    ->warning(t('WSServer %label (%type) was disabled.', [
    '%label' => $this
      ->label(),
    '%type' => $this->wsconnector,
  ]) . $reason);
}