public function count() { return $this->getEntityManager()->createQuery('SELECT COUNT(e.id) FROM ' . $this->getEntityName() . ' e')->getSingleScalarResult(); }