interface-sitemap-cache-data.php 1.05 KB
Newer Older
imac's avatar
imac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
<?php
/**
 * @package WPSEO\XML_Sitemaps
 */

/**
 * Cache Data interface
 */
interface WPSEO_Sitemap_Cache_Data_Interface {

	/** Status for normal, usable sitemap. */
	const OK = 'ok';

	/** Status for unusable sitemap. */
	const ERROR = 'error';

	/** Status for unusable sitemap because it cannot be identified. */
	const UNKNOWN = 'unknown';

	/**
	 * Set the content of the sitemap
	 *
	 * @param string $sitemap The XML content of the sitemap.
	 *
	 * @return void
	 */
	public function set_sitemap( $sitemap );

	/**
	 * Set the status of the sitemap
	 *
	 * @param bool|string $usable True/False or 'ok'/'error' for status.
	 *
	 * @return void
	 */
	public function set_status( $usable );

	/**
	 * @return string The XML content of the sitemap.
	 */
	public function get_sitemap();

	/**
	 * Get the status of this sitemap
	 *
	 * @return string Status 'ok', 'error' or 'unknown'.
	 */
	public function get_status();

	/**
	 * Is the sitemap content usable
	 *
	 * @return bool True if the sitemap is usable, False if not.
	 */
	public function is_usable();
}