public function setTotalCountByQueryBuilder(QueryBuilder $queryBuilder)
    {
        $queryBuilder
            ->select(sprintf('COUNT(%s)', $queryBuilder->getRootAliases()[0]))
            ->setMaxResults(1);

        return $this->setTotalCount(intval($queryBuilder->getQuery()->getSingleScalarResult()));
    }