RestResourceConfigInterface.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Drupal\rest;
  3. use Drupal\Core\Config\Entity\ConfigEntityInterface;
  4. use Drupal\Core\Entity\EntityWithPluginCollectionInterface;
  5. /**
  6. * Defines a configuration entity to store enabled REST resources.
  7. */
  8. interface RestResourceConfigInterface extends ConfigEntityInterface, EntityWithPluginCollectionInterface {
  9. /**
  10. * Granularity value for per-method configuration.
  11. */
  12. const METHOD_GRANULARITY = 'method';
  13. /**
  14. * Granularity value for per-resource configuration.
  15. */
  16. const RESOURCE_GRANULARITY = 'resource';
  17. /**
  18. * Retrieves the REST resource plugin.
  19. *
  20. * @return \Drupal\rest\Plugin\ResourceInterface
  21. * The resource plugin
  22. */
  23. public function getResourcePlugin();
  24. /**
  25. * Retrieves a list of supported HTTP methods.
  26. *
  27. * @return string[]
  28. * A list of supported HTTP methods.
  29. */
  30. public function getMethods();
  31. /**
  32. * Retrieves a list of supported authentication providers.
  33. *
  34. * @param string $method
  35. * The request method e.g GET or POST.
  36. *
  37. * @return string[]
  38. * A list of supported authentication provider IDs.
  39. */
  40. public function getAuthenticationProviders($method);
  41. /**
  42. * Retrieves a list of supported response formats.
  43. *
  44. * @param string $method
  45. * The request method e.g GET or POST.
  46. *
  47. * @return string[]
  48. * A list of supported format IDs.
  49. */
  50. public function getFormats($method);
  51. }