interface-indexable-provider.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Endpoints
  6. */
  7. /**
  8. * Dictates the required methods for an indexable service provider.
  9. */
  10. interface WPSEO_Indexable_Service_Provider {
  11. /**
  12. * Returns an array with data for the target object.
  13. *
  14. * @param integer $object_id The target object id.
  15. * @param bool $as_object Optional. Whether or not to return the indexable
  16. * as an object. Defaults to false.
  17. *
  18. * @return array The retrieved data.
  19. */
  20. public function get( $object_id, $as_object = false );
  21. /**
  22. * Handles the patching of values for an existing indexable.
  23. *
  24. * @param int $object_id The ID of the object.
  25. * @param array $requestdata The request data to store.
  26. *
  27. * @return array The patched indexable.
  28. */
  29. public function patch( $object_id, $requestdata );
  30. /**
  31. * Checks if the given object id belongs to an indexable.
  32. *
  33. * @param int $object_id The object id.
  34. *
  35. * @return bool Whether the object id is indexable.
  36. */
  37. public function is_indexable( $object_id );
  38. }