lib/Doctrine/ORM/LazyCriteriaCollection.php
public function count()
    {
        if ($this->isInitialized()) {
            return $this->collection->count();
        }

        // Return cached result in case count query was already executed
        if ($this->count !== null) {
            return $this->count;
        }

        return $this->count = $this->entityPersister->count($this->criteria);
    }
public function count()
    {
        if ($this->isInitialized()) {
            return $this->collection->count();
        }

        // Return cached result in case count query was already executed
        if ($this->count !== null) {
            return $this->count;
        }

        return $this->count = $this->entityPersister->count($this->criteria);
    }
public function count ( ) { if ( $ this -> isInitialized ( ) ) { return $ this -> collection -> count ( ) ; } // Return cached result in case count query was already executed if ( $ this -> count !== null ) { return $ this -> count ; } return $ this -> count = $ this -> entityPersister -> count ( $ this -> criteria ) ; }
Do an efficient count on the collection

@return int
Do an efficient count on the collection