GravResultObject.php 510 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Grav\Plugin\TNTSearch;
  3. class GravResultObject
  4. {
  5. /** @var array */
  6. protected $items;
  7. /** @var int */
  8. protected $counter;
  9. /**
  10. * GravResultObject constructor.
  11. * @param array $items
  12. */
  13. public function __construct($items)
  14. {
  15. $this->counter = 0;
  16. $this->items = $items;
  17. }
  18. /**
  19. * @param array $options
  20. * @return array
  21. */
  22. public function fetch($options)
  23. {
  24. return $this->items[$this->counter++];
  25. }
  26. }