protected function decodePageParameter($context = '', $inParameters = null)
    {
        if (isset($inParameters['page']) && $inParameters['page'] !== null) {
            return $inParameters['page'];
        } else {
            $param = Pager::makeParameterId($context);
            /* @var $query \Symfony\Component\HttpFoundation\ParameterBag */
            $query = $this->app['request']->query;
            $page = ($query) ? $query->get($param, $query->get('page', 1)) : 1;
        }

        return $page;
    }