public function count(array $constraints = [], QueryBuilder $qb = null)
    {
        $qb = !is_null($qb) ? $qb : $this->createQueryBuilder('e');
        if (count($constraints)) $qb = $this->_by($qb, $constraints);
        return $this->arrange($this->_count($qb), Repository::RESULT_SHAPE_SCALAR);
    }
public function count(array $constraints = [], QueryBuilder $qb = null)
    {
        $qb = !is_null($qb) ? $qb : $this->createQueryBuilder('e');
        if (count($constraints)) $qb = $this->_by($qb, $constraints);
        return $this->arrange($this->_count($qb), Repository::RESULT_SHAPE_SCALAR);
    }
public function count ( array $ constraints = [ ] , QueryBuilder $ qb = null ) { $ qb = ! is_null ( $ qb ) ? $ qb : $ this -> createQueryBuilder ( 'e' ) ; if ( count ( $ constraints ) ) $ qb = $ this -> _by ( $ qb , $ constraints ) ; return $ this -> arrange ( $ this -> _count ( $ qb ) , Repository :: RESULT_SHAPE_SCALAR ) ; }
Return number of entities

@param Doctrine\ORM\QueryBuilder = null
@return integer
Return number of entities