Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RestResourceConfig.php

function 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 113

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.');
    }
}
RSS feed
Powered by Drupal