public function getNumUsers() { try { $result = (int) count($this->getImageCollection()->distinct('user')); return $result; } catch (MongoException $e) { throw new DatabaseException('Unable to fetch information from the database', 500, $e); } }