public function getNumberOfElements(): ?int
    {
        $this->checkRepository();

        return $this->_em->createQueryBuilder()
            ->select('count(a)')
            ->from($this->getEntityName(), 'a')
            ->getQuery()
            ->getSingleScalarResult()
        ;
    }