function RestResourceConfig::getAuthenticationProviders

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

Overrides RestResourceConfigInterface::getAuthenticationProviders

File

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

Class

RestResourceConfig
Defines a RestResourceConfig configuration entity class.

Namespace

Drupal\rest\Entity

Code

public function getAuthenticationProviders($method) {
    switch ($this->granularity) {
        case RestResourceConfigInterface::METHOD_GRANULARITY:
            return $this->getAuthenticationProvidersForMethodGranularity($method);
        case RestResourceConfigInterface::RESOURCE_GRANULARITY:
            return $this->configuration['authentication'];
        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.