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

        return $this->_em->createQueryBuilder()
            ->select('count(a)')
            ->from($this->getEntityName(), 'a')
            ->getQuery()
            ->getSingleScalarResult()
        ;
    }
public function getNumberOfElements(): ?int
    {
        $this->checkRepository();

        return $this->_em->createQueryBuilder()
            ->select('count(a)')
            ->from($this->getEntityName(), 'a')
            ->getQuery()
            ->getSingleScalarResult()
        ;
    }
public function getNumberOfElements ( ) : ? int { $ this -> checkRepository ( ) ; return $ this -> _em -> createQueryBuilder ( ) -> select ( 'count(a)' ) -> from ( $ this -> getEntityName ( ) , 'a' ) -> getQuery ( ) -> getSingleScalarResult ( ) ; }
Gets total number of elements in the table.
Gets total number of elements in the table .