private function generateLinks($route, $page, $numPages, $perPage, Request $request, $rql)
    {
        if ($page > 2) {
            $this->generateLink($route, 1, $perPage, 'first', $request, $rql);
        }
        if ($page > 1) {
            $this->generateLink($route, $page - 1, $perPage, 'prev', $request, $rql);
        }
        if ($page < $numPages) {
            $this->generateLink($route, $page + 1, $perPage, 'next', $request, $rql);
        }
        if ($page != $numPages) {
            $this->generateLink($route, $numPages, $perPage, 'last', $request, $rql);
        }
    }