public function ResourceBase::availableMethods

Implements ResourceInterface::availableMethods().

Overrides ResourceInterface::availableMethods

2 calls to ResourceBase::availableMethods()
ResourceBase::permissions in drupal/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.php
Implements ResourceInterface::permissions().
ResourceBase::routes in drupal/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.php
Implements ResourceInterface::routes().

File

drupal/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.php, line 116
Definition of Drupal\rest\Plugin\ResourceBase.

Class

ResourceBase
Common base class for resource plugins.

Namespace

Drupal\rest\Plugin

Code

public function availableMethods() {
  $methods = $this
    ->requestMethods();
  $available = array();
  foreach ($methods as $method) {

    // Only expose methods where the HTTP request method exists on the plugin.
    if (method_exists($this, strtolower($method))) {
      $available[] = $method;
    }
  }
  return $available;
}