public function getLimit()
    {
        $default = 10;
        if ('csv' === $this->getRequest()->getRequestFormat()) {
            $default = null;
        }

        // set default limit to count of ids if result is restricted to specific ids
        $ids = $this->getIds();
        if (null != $ids) {
            $default = count($ids);
        }

        return $this->getRequest()->get('limit', $default);
    }