PagesSourceInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @package Grav\Common\Page
  4. *
  5. * @copyright Copyright (c) 2015 - 2023 Trilby Media, LLC. All rights reserved.
  6. * @license MIT License; see LICENSE file for details.
  7. */
  8. namespace Grav\Common\Page\Interfaces;
  9. /**
  10. * Interface PagesSourceInterface
  11. * @package Grav\Common\Page\Interfaces
  12. */
  13. interface PagesSourceInterface // extends \Iterator
  14. {
  15. /**
  16. * Get timestamp for the page source.
  17. *
  18. * @return int
  19. */
  20. public function getTimestamp(): int;
  21. /**
  22. * Get checksum for the page source.
  23. *
  24. * @return string
  25. */
  26. public function getChecksum(): string;
  27. /**
  28. * Returns true if the source contains a page for the given route.
  29. *
  30. * @param string $route
  31. * @return bool
  32. */
  33. public function has(string $route): bool;
  34. /**
  35. * Get the page for the given route.
  36. *
  37. * @param string $route
  38. * @return PageInterface|null
  39. */
  40. public function get(string $route): ?PageInterface;
  41. /**
  42. * Get the children for the given route.
  43. *
  44. * @param string $route
  45. * @param array|null $options
  46. * @return array
  47. */
  48. public function getChildren(string $route, array $options = null): array;
  49. }