You are here

public function ResourceFieldBase::setMethods in RESTful 7.2

Parameters

array $methods:

Throws

ServerConfigurationException

Overrides ResourceFieldInterface::setMethods

File

src/Plugin/resource/Field/ResourceFieldBase.php, line 273
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldBase.

Class

ResourceFieldBase

Namespace

Drupal\restful\Plugin\resource\Field

Code

public function setMethods($methods) {
  foreach ($methods as $method) {
    if (Request::isValidMethod($method)) {
      throw new ServerConfigurationException(sprintf('The method %s in the field resource mapping is not valid.', $method));
    }
  }
  $this->methods = $methods;
}