main/app/Persistence/ObjectManager.php
public function count($class)
    {
        $dql = "SELECT COUNT(object) FROM {$class} object";
        $query = $this->wrapped->createQuery($dql);

        return (int) $query->getSingleScalarResult();
    }
public function count($class)
    {
        $dql = "SELECT COUNT(object) FROM {$class} object";
        $query = $this->wrapped->createQuery($dql);

        return (int) $query->getSingleScalarResult();
    }
public function count ( $ class ) { $ dql = "SELECT COUNT(object) FROM {$class} object" ; $ query = $ this -> wrapped -> createQuery ( $ dql ) ; return ( int ) $ query -> getSingleScalarResult ( ) ; }
Counts objects of a given class.

@param string $class

@return int

@todo make this method compatible with odm implementations
Counts objects of a given class .