You are here

public function WsConfigType::disable in Web Service Data 7

API function to disabled this wsconfig type.

File

modules/wsconfig/wsconfig.entity.inc, line 439
Entity classes

Class

WsConfigType
The class used for wsconfig type entities

Code

public function disable($degraded = FALSE) {
  $reason = '';
  if ($degraded) {
    if (!isset($this->data['degraded_backoff'])) {
      $this->data['degraded_backoff'] = WSCONFIG_DEFAULT_DEGRADED_BACKOFF;
    }
    if ($this->data['degraded_backoff'] == 0) {
      return;
    }
    $reason = '  ' . t('Automatically disabled due to degrated service.');
    $this->data['degraded'] = time();
  }
  $this->data['disabled'] = TRUE;
  watchdog('wsconfig', t('WSConfig Type %label (%type) was disabled.', array(
    '%label' => $this->label,
    '%type' => $this->type,
  )) . $reason);
  $this
    ->save();
}