RestResourceConfig::getMethods

public RestResourceConfig::getMethods()

Retrieves a list of supported HTTP methods.

Return value

string[] A list of supported HTTP methods.

Overrides RestResourceConfigInterface::getMethods

File

core/modules/rest/src/Entity/RestResourceConfig.php, line 116

Class

RestResourceConfig
Defines a RestResourceConfig configuration entity class.

Namespace

Drupal\rest\Entity

Code

public function getMethods() {
  switch ($this->granularity) {
    case RestResourceConfigInterface::METHOD_GRANULARITY:
      return $this->getMethodsForMethodGranularity();
    case RestResourceConfigInterface::RESOURCE_GRANULARITY:
      return $this->configuration['methods'];
    default:
      throw new \InvalidArgumentException('Invalid granularity specified.');
  }
}
doc_Drupal
2016-10-29 09:38:20
Comments
Leave a Comment

Please login to continue.