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);
    }