<?php

namespace Plainwork\Ui\Component;

final class Pager
{
    private int $limit = 10;
    private int $offset = 0;
    private int $totalCount = 0;
    private string $paramOffset = 'offset-';
    private string $paramLimit = 'limit-';

    public function __construct(int $totalCount, int $limit = 10, int $offset = 0)
    {
        $this->totalCount = $totalCount;
        $this->limit = $limit;
        $this->offset = $offset;
    }

    public function getOffset(): int
    {
        return $this->offset;
    }

    public function setOffset(int $i): self
    {
        $this->offset = $i;

        return $this;
    }

    public function getTotalCount(): int
    {
        return $this->totalCount;
    }

    public function getLimit(): int
    {
        return $this->limit;
    }

    public function setLimit(int $i): self
    {
        $this->limit = $i;

        return $this;
    }

    public function getParamOffset(): string
    {
        return $this->paramOffset;
    }

    public function getParamLimit(): string
    {
        return $this->paramLimit;
    }
}
