private function addRangeToContent(Response $response, $collection, $offset, $limit)
    {
        $total = "*";
        if ($collection instanceof Paginator) {
            $total = count($collection);
        }

        $lastResult = $offset + $limit - 1;
        $lastResult = $lastResult < 0 ? 0 : $lastResult;
        $response->headers->set('Content-Range', "$offset-$lastResult/" . $total);

        return $response;
    }
private function addRangeToContent(Response $response, $collection, $offset, $limit)
    {
        $total = "*";
        if ($collection instanceof Paginator) {
            $total = count($collection);
        }

        $lastResult = $offset + $limit - 1;
        $lastResult = $lastResult < 0 ? 0 : $lastResult;
        $response->headers->set('Content-Range', "$offset-$lastResult/" . $total);

        return $response;
    }
private function addRangeToContent ( Response $ response , $ collection , $ offset , $ limit ) { $ total = "*" ; if ( $ collection instanceof Paginator ) { $ total = count ( $ collection ) ; } $ lastResult = $ offset + $ limit - 1 ; $ lastResult = $ lastResult < 0 ? 0 : $ lastResult ; $ response -> headers -> set ( 'Content-Range' , "$offset-$lastResult/" . $ total ) ; return $ response ; }
Add range to content.

@param   Response    $response
@param   array       $collection
@param   int         $offset
@param   int         $limit
@return  Response
Add range to content .