function RestResourceConfig::getMethods

Same name in other branches
  1. 9 core/modules/rest/src/Entity/RestResourceConfig.php \Drupal\rest\Entity\RestResourceConfig::getMethods()
  2. 10 core/modules/rest/src/Entity/RestResourceConfig.php \Drupal\rest\Entity\RestResourceConfig::getMethods()
  3. 11.x core/modules/rest/src/Entity/RestResourceConfig.php \Drupal\rest\Entity\RestResourceConfig::getMethods()

Overrides RestResourceConfigInterface::getMethods

2 calls to RestResourceConfig::getMethods()
RestResourceConfig::getAuthenticationProvidersForMethodGranularity in core/modules/rest/src/Entity/RestResourceConfig.php
Retrieves a list of supported authentication providers.
RestResourceConfig::getFormatsForMethodGranularity in core/modules/rest/src/Entity/RestResourceConfig.php
Retrieves a list of supported response formats.

File

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

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.');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.