/** * Gets the 'knp_paginator' service. * * This service is shared. * This method always returns the same instance of the service. * * @return \Knp\Component\Pager\Paginator A Knp\Component\Pager\Paginator instance. */ protected function getKnpPaginatorService() { $this->services['knp_paginator'] = $instance = new \Knp\Component\Pager\Paginator($this->get('debug.event_dispatcher')); $instance->setDefaultPaginatorOptions(array('pageParameterName' => 'page', 'sortFieldParameterName' => 'sort', 'sortDirectionParameterName' => 'direction', 'filterFieldParameterName' => 'filterField', 'filterValueParameterName' => 'filterValue', 'distinct' => true)); return $instance; }