LinkRelationTypeInterface.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace Drupal\Core\Http;
  3. /**
  4. * Defines a single link relation type.
  5. *
  6. * An example of a link relation type is 'canonical'. It represents a canonical,
  7. * definite representation of a resource.
  8. *
  9. * @see \Drupal\Core\Http\LinkRelationTypeManager
  10. * @see https://tools.ietf.org/html/rfc5988#page-6
  11. */
  12. interface LinkRelationTypeInterface {
  13. /**
  14. * Indicates whether this link relation type is of the 'registered' kind.
  15. *
  16. * @return bool
  17. *
  18. * @see https://tools.ietf.org/html/rfc5988#section-4.1
  19. */
  20. public function isRegistered();
  21. /**
  22. * Indicates whether this link relation type is of the 'extension' kind.
  23. *
  24. * @return bool
  25. *
  26. * @see https://tools.ietf.org/html/rfc5988#section-4.2
  27. */
  28. public function isExtension();
  29. /**
  30. * Returns the registered link relation type name.
  31. *
  32. * Only available for link relation types of the KIND_REGISTERED kind.
  33. *
  34. * @return string|null
  35. * The name of the registered relation type.
  36. *
  37. * @see https://tools.ietf.org/html/rfc5988#section-4.1
  38. */
  39. public function getRegisteredName();
  40. /**
  41. * Returns the extension link relation type URI.
  42. *
  43. * Only available for link relation types of the KIND_EXTENSION kind.
  44. *
  45. * @return string
  46. * The URI of the extension relation type.
  47. *
  48. * @see https://tools.ietf.org/html/rfc5988#section-4.2
  49. */
  50. public function getExtensionUri();
  51. /**
  52. * Returns the link relation type description.
  53. *
  54. * @return string
  55. * The link relation type description.
  56. *
  57. * @see https://tools.ietf.org/html/rfc5988#section-6.2.1
  58. */
  59. public function getDescription();
  60. /**
  61. * Returns the URL pointing to the reference of the link relation type.
  62. *
  63. * @return string
  64. * The URL pointing to the reference.
  65. *
  66. * @see https://tools.ietf.org/html/rfc5988#section-6.2.1
  67. */
  68. public function getReference();
  69. /**
  70. * Returns some extra notes/comments about this link relation type.
  71. *
  72. * @return string
  73. * The notes about the link relation.
  74. *
  75. * @see https://tools.ietf.org/html/rfc5988#section-6.2.1
  76. */
  77. public function getNotes();
  78. }