function RestResourceConfig::getFormats
Overrides RestResourceConfigInterface::getFormats
File
-
core/
modules/ rest/ src/ Entity/ RestResourceConfig.php, line 173
Class
- RestResourceConfig
- Defines a RestResourceConfig configuration entity class.
Namespace
Drupal\rest\EntityCode
public function getFormats($method) {
switch ($this->granularity) {
case RestResourceConfigInterface::METHOD_GRANULARITY:
return $this->getFormatsForMethodGranularity($method);
case RestResourceConfigInterface::RESOURCE_GRANULARITY:
return $this->configuration['formats'];
default:
throw new \InvalidArgumentException('Invalid granularity specified.');
}
}