public function paginate($perPage = 25, QueryParameters $queryParameters = null, $currentPage = null, $searchQuery = null) {
        $currentPage = $currentPage === null ? $this->paginator->getCurrentPage() : $currentPage;

        $qb = $this->addSearchConditions($this->createSelectQuery(), $searchQuery);

        $qb = $qb->setFirstResult($perPage * ($currentPage - 1))
                 ->setMaxResults($perPage);
        $items = $this->getQuery($qb, $queryParameters)->getResult();

        $count = $this->addSearchConditions($this->createCountQuery(), $searchQuery);
        $count = (int) $this->getQuery($count, $queryParameters)->getSingleScalarResult();

        return $this->paginator->make($items, $count, $perPage);
    }