Airship\Cabin\Bridge\Landing\Skyport::getPaginated PHP Method

getPaginated() protected method

Get the page number and offset
protected getPaginated ( integer $sizeOfList ) : array
$sizeOfList integer
return array
    protected function getPaginated(int $sizeOfList) : array
    {
        $page = (int) ($_POST['page'] ?? 1);
        if (($page - 1) * $this->perPage > $sizeOfList) {
            $page = 1;
        }
        if ($page < 1) {
            $page = 1;
        }
        return [(int) $page, (int) ($page - 1) * $this->perPage];
    }