interface-sitemap-cache-data.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\XML_Sitemaps
  6. */
  7. /**
  8. * Cache Data interface.
  9. */
  10. interface WPSEO_Sitemap_Cache_Data_Interface {
  11. /**
  12. * Status for normal, usable sitemap.
  13. *
  14. * @var string
  15. */
  16. const OK = 'ok';
  17. /**
  18. * Status for unusable sitemap.
  19. *
  20. * @var string
  21. */
  22. const ERROR = 'error';
  23. /**
  24. * Status for unusable sitemap because it cannot be identified.
  25. *
  26. * @var string
  27. */
  28. const UNKNOWN = 'unknown';
  29. /**
  30. * Set the content of the sitemap.
  31. *
  32. * @param string $sitemap The XML content of the sitemap.
  33. *
  34. * @return void
  35. */
  36. public function set_sitemap( $sitemap );
  37. /**
  38. * Set the status of the sitemap.
  39. *
  40. * @param bool|string $usable True/False or 'ok'/'error' for status.
  41. *
  42. * @return void
  43. */
  44. public function set_status( $usable );
  45. /**
  46. * Builds the sitemap.
  47. *
  48. * @return string The XML content of the sitemap.
  49. */
  50. public function get_sitemap();
  51. /**
  52. * Get the status of this sitemap.
  53. *
  54. * @return string Status 'ok', 'error' or 'unknown'.
  55. */
  56. public function get_status();
  57. /**
  58. * Is the sitemap content usable ?
  59. *
  60. * @return bool True if the sitemap is usable, False if not.
  61. */
  62. public function is_usable();
  63. }