code: public function getCount(array $criteria)
      {
          $persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
  
          return $persister->count($criteria);
      }
docs: Get count
  
  @param array $criteria
  @return integer