private function getQueryOptions($pagination)
    {
        // Some options that are the same for all three cases
        $options = [
            'order'     => 'date',
            'direction' => 'DESC',
        ];

        if ($pagination['limit']) {
            $options['limit'] = $pagination['limit'];
        }
        if ($pagination['page'] > 0 && $pagination['limit']) {
            $options['offset'] = ($pagination['page'] - 1) * $pagination['limit'];
        }

        return $options;
    }
private function getQueryOptions($pagination)
    {
        // Some options that are the same for all three cases
        $options = [
            'order'     => 'date',
            'direction' => 'DESC',
        ];

        if ($pagination['limit']) {
            $options['limit'] = $pagination['limit'];
        }
        if ($pagination['page'] > 0 && $pagination['limit']) {
            $options['offset'] = ($pagination['page'] - 1) * $pagination['limit'];
        }

        return $options;
    }
private function getQueryOptions ( $ pagination ) { // Some options that are the same for all three cases $ options = [ 'order' => 'date' , 'direction' => 'DESC' , ] ; if ( $ pagination [ 'limit' ] ) { $ options [ 'limit' ] = $ pagination [ 'limit' ] ; } if ( $ pagination [ 'page' ] > 0 && $ pagination [ 'limit' ] ) { $ options [ 'offset' ] = ( $ pagination [ 'page' ] - 1 ) * $ pagination [ 'limit' ] ; } return $ options ; }
Calculate the query options.

@param array $pagination

@return array
Calculate the query options .