src/Graviton/RestBundle/Listener/LinkHeaderResponseListener.php
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);
        }
    }
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);
        }
    }
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 ) ; } }
generate headers for all paging links

@param string  $route    name of route
@param integer $page     page to link to
@param integer $numPages number of all pages
@param integer $perPage  number of records per page
@param Request $request  request to get rawRql from
@param string  $rql      rql query string

@return void
generate headers for all paging links