@param $source
@param array                           $parameters
@param PaginationHandlerInterface|null $handler

@return Pagination
186357
protected function createPagination($source, array $parameters = [], ?PaginationHandlerInterface $handler = null)
    {
        if (false === $this->container->has('pagination.factory')) {
            throw new \LogicException('You can not use the "createPagination" method if the Pagination Component are not available.');
        }

        if (is_null($handler)) {
            $handler = $this->container->get('pagination.handler.request');
        }

        $factory = $this->container->get('pagination.factory');

        return $factory->createPagination($source, $parameters, $handler);
    }
521226
public static function dataTablePaginate($request, $parameters = [])
    {
        // Datatable paginate
        $parameters['start']   = null;
        $parameters['length']  = null;

        if($request->input('start') != null && $request->input('length') != '-1')
        {
            $parameters['start']    = $request->input('start');
            $parameters['length']   = $request->input('length');
        }

        return $parameters;
    }
749504
public static function run( $query, $params = array(), $handler = null ) 
	{
		return Handler::create( $handler )->run( $query, $params );
	}
1312204
public function absoluteUrl($handler, array $data = [], array $query_params = [])
    {
        return $this->url($handler, $data, $query_params, true);
    }
1080854
public function get($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('GET', $path);
        return $this->addRuler($ruler, $handler);
    }
1151059
protected function _toNavigationArray(\Gems_Menu_ParameterCollector $source)
    {
        $this->sortByOrder();
        $lastParams = null;
        $pageIdx    = 0;
        $pages      = array();
        foreach ($this->_subItems as $item) {
            // Skip button_only items
            if ($item->get('button_only')) {
                continue;
            }
            $page = $item->_toNavigationArray($source);

            if (($this instanceof \Gems_Menu_SubMenuItem) &&
                    (!$this->notSet('controller', 'action')) &&
                    isset($page['params'])) {

                $params = $page['params'];
                unset($params['reset']); // Ignore this setting

                $class = [];
                if (isset($page['class'])) {
                    $class[] = $page['class'];
                }
                if (empty($params)) {
                    $class[] = 'noParameters';
                }
                if ((null !== $lastParams) && ($lastParams !== $params)) {
                    $class[] = 'breakBefore';
                }

                if (!empty($class)) {
                    $page['class'] = join(' ', $class);
                }
                $lastParams = $params;
            }
            $pages[$pageIdx] = $page;
            $pageIdx++;
        }

        return $pages;
    }
332683
public static function relative($handler, array $params = [])
    {
        return substr(app()->request->base_url, 0, -1).app()->router->generate($handler, $params);
    }
342484
public function paginate($builder = null, $options = [])
    {
		$options = array_merge(['pageName' => 'page', 'columns' => ['*'],
            'perPage' => null, 'page' => null
        ], $options);

        return $this->getModel()
        	->paginate(
        		$options['perPage'], $options['columns'], $options['pageName'], $options['page']
        	);
    }
55014
public static function get($route, $handler, $options = [])
    {
        app()->router->get($route, $handler, $options);
    }
422522
protected function getPageNumber(EncodingParametersInterface $parameters)
    {
        $paging = $parameters->getPaginationParameters();
        return isset($paging[self::PARAM_PAGING_NUMBER]) ? $paging[self::PARAM_PAGING_NUMBER] : null;
    }
1087447
public function newRecord($domain, array $parameters)
    {
        $this->checkParameters($parameters);

        return $this->processQuery(
            $this->buildRecordsQuery($domain, null, RecordsActions::ACTION_ADD, $parameters)
        );
    }
1272599
final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
        if ($this->_next) {
            return $this->_next->process($request, $handler);
        }
        return $handler->handle($request);
    }
521139
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $route = $this->router->dispatch($request->getMethod(), rawurldecode($request->getUri()->getPath()));

        if ($route[0] === Dispatcher::NOT_FOUND) {
            return $this->createResponse(404);
        }

        if ($route[0] === Dispatcher::METHOD_NOT_ALLOWED) {
            return $this->createResponse(405)->withHeader('Allow', implode(', ', $route[1]));
        }

        foreach ($route[2] as $name => $value) {
            $request = $request->withAttribute($name, $value);
        }

        $request = $this->setHandler($request, $route[1]);

        return $handler->handle($request);
    }
13185
public static function fetch( $query, $params = array(), $handler = null, $arguments = array( 'obj' ) ) 
	{
		return Handler::create( $handler )->fetch( $query, $params, $arguments );
	}
787300
public static void bind(Source source, RouteParameterHandler handler) {
        if (BINDINGS.containsKey(source)) {
            LoggerFactory.getLogger(Bindings.class).warn("Replacing a route parameter binding for {} by {}",
                    source.name(), handler);
        }
        BINDINGS.put(source, handler);
    }
1356214
public static function select( $table, $fields = array(), $handler = null ) 
	{
		return Query::select( $table, $fields, $handler );
	}
1093869
public function paginate(
        PagerService $pager,
        $route,
        array $parameters = [],
        $template = 'ONGRPagerBundle:Pager:paginate.html.twig'
    ) {
        return $this->environment->render(
            $template,
            ['pager' => $pager, 'route' => $route, 'parameters' => $parameters]
        );
    }