No Description

Repository.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /*******************************************************************************
  3. * Copyright (c) 2019, Code Atlantic LLC
  4. ******************************************************************************/
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit;
  7. }
  8. /**
  9. * Interface PUM_Interface_Repository
  10. *
  11. * Interface between WP_Query and our data needs. Essentially a query factory.
  12. *
  13. * @package ForumWP\Interfaces
  14. */
  15. interface PUM_Interface_Repository {
  16. /**
  17. * @param int $id
  18. *
  19. * @return WP_Post|PUM_Abstract_Model_Post
  20. */
  21. public function get_item( $id );
  22. /**
  23. * @param int $id
  24. *
  25. * @return bool
  26. */
  27. public function has_item( $id );
  28. /**
  29. * @param array $args
  30. *
  31. * @return WP_Post[||PUM_Abstract_Model_Post[]
  32. */
  33. public function get_items( $args = array() );
  34. /**
  35. * @param array $data
  36. *
  37. * @return WP_Post|PUM_Abstract_Model_Post
  38. */
  39. public function create_item( $data );
  40. /**
  41. * @param int $id
  42. * @param array $data
  43. *
  44. * @return WP_Post|PUM_Abstract_Model_Post
  45. */
  46. public function update_item( $id, $data );
  47. /**
  48. * @param int $id
  49. *
  50. * @return bool
  51. */
  52. public function delete_item( $id );
  53. }