abstract class WsConnector in Web Service Data 7
Class definition for Web Service Connector
Hierarchy
- class \WsConnector
Expanded class hierarchy of WsConnector
File
- ./
wsdata.module, line 303 - Main module for wsconfig
View source
abstract class WsConnector {
protected $expires;
protected $cacheDefaultTime;
protected $cacheDefaultOverride;
protected $staleCache;
protected $endpoint;
protected $error;
// All connectors support the default plugin by default.
// The plugin essentially means all the language data is
// in the single request.
protected $languagePlugins = array(
'default',
);
public function getEndpoint() {
return $this->endpoint;
}
public function __construct($endpoint) {
$this->endpoint = trim($endpoint);
$this->expires = 0;
$this->cacheDefaultTime = 0;
$this->cacheDefaultOverride = FALSE;
$this->staleCache = FALSE;
}
public function supportsCaching() {
return FALSE;
}
public function getError() {
return $this->error;
}
/**
* Return the list of supported language handling plugins
*/
public function getSupportedLanguagePlugins() {
return $this->languagePlugins;
}
public function defaultCache($mintime = 0, $override = FALSE, $stale = FALSE) {
$this->cacheDefaultTime = $mintime;
$this->cacheDefaultOverride = $override;
$this->staleCache = $stale;
}
abstract function getMethods();
public abstract function wscall($type, $method, $argument, $options);
public function create($method, $object, $options = array()) {
$this->expires = 0;
return $this
->wscall('create', $method, $object, $options);
}
public function read($method, $id, $options = array()) {
$this->expires = 0;
return $this
->wscall('read', $method, $id, $options);
}
public function update($id, $method, $object, $options = array()) {
$this->expires = 0;
return $this
->wscall('update', $method, array(
$id,
$object,
), $options);
}
public function delete($id, $method, $options = array()) {
$this->expires = 0;
return $this
->wscall('delete', $method, $id, $options);
}
public function index($method, $options = array()) {
$this->expires = 0;
return $this
->wscall('index', $method, array(), $options);
}
public function expires() {
if ($this->expires > 0) {
return $this->expires;
}
else {
return FALSE;
}
}
public function isDegraded() {
return FALSE;
}
protected function setError($code, $message) {
$this->error = array(
'code' => $code,
'message' => $message,
);
}
protected function clearError() {
$this->error = NULL;
}
}