protected function getPager(AdapterInterface $adapter, $currentPage, $maxPerPage)
    {
        @trigger_error(
            'PagerfantaFindTrait is deprecated since version 2.5 and will be removed in 3.0. Use PagerfantaTrait instead.',
            E_USER_DEPRECATED
        );

        $pager = new Pagerfanta($adapter);
        $pager->setNormalizeOutOfRangePages(true);
        $pager->setMaxPerPage($maxPerPage);
        $pager->setCurrentPage($currentPage);

        return $pager;
    }