src/Bridge/Porpaginas/Doctrine/ORM/FakeORMQueryPage.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Bridge\Porpaginas\Doctrine\ORM;
  3. use ArrayIterator;
  4. use Porpaginas\Page;
  5. class FakeORMQueryPage implements Page
  6. {
  7.     public function __construct(
  8.         protected int $currentOffset,
  9.         protected int $currentPage,
  10.         protected int $currentLimit,
  11.         protected int $totalCount,
  12.         protected array $results
  13.     ) {}
  14.     public function getCurrentOffset(): int
  15.     {
  16.         return $this->currentOffset;
  17.     }
  18.     public function getCurrentPage(): int
  19.     {
  20.         return $this->currentPage;
  21.     }
  22.     public function getCurrentLimit(): int
  23.     {
  24.         return $this->currentLimit;
  25.     }
  26.     public function count(): int
  27.     {
  28.         return count($this->results);
  29.     }
  30.     public function totalCount(): int
  31.     {
  32.         return $this->totalCount;
  33.     }
  34.     public function getIterator(): iterable
  35.     {
  36.         return new ArrayIterator($this->results);
  37.     }
  38.     public function getArray(): array
  39.     {
  40.         return $this->results;
  41.     }
  42. }