You are here

public function WsConfig::addMethod in Web Service Data 7

File

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

Class

WsConfig
The class used for wsconfig entities

Code

public function addMethod($type, $name = '') {
  $methods = $this
    ->getPossibleMethods();
  if (!isset($methods[$type])) {
    return FALSE;
  }
  $methodname = $type;
  $supported = $this->connector
    ->getMethods();
  if (isset($supported['multiple'][$type])) {
    $name = drupal_strtolower(preg_replace('/\\W/', '', $name));
    if (empty($name)) {
      return FALSE;
    }
    $methodname .= '_' . $name;
  }
  $this->data[$this
    ->getMethodKey($methodname)] = '';
  return TRUE;
}