<?php
namespace App\Bridge\Porpaginas\Doctrine\ORM;
use ArrayIterator;
use Porpaginas\Page;
class FakeORMQueryPage implements Page
{
public function __construct(
protected int $currentOffset,
protected int $currentPage,
protected int $currentLimit,
protected int $totalCount,
protected array $results
) {}
public function getCurrentOffset(): int
{
return $this->currentOffset;
}
public function getCurrentPage(): int
{
return $this->currentPage;
}
public function getCurrentLimit(): int
{
return $this->currentLimit;
}
public function count(): int
{
return count($this->results);
}
public function totalCount(): int
{
return $this->totalCount;
}
public function getIterator(): iterable
{
return new ArrayIterator($this->results);
}
public function getArray(): array
{
return $this->results;
}
}