public function getApplicantCount($Force = false)
{
if (c('Garden.Registration.Method') != 'Approval') {
return 0;
}
$CacheKey = 'Moderation.ApplicantCount';
if ($Force) {
Gdn::cache()->Remove($CacheKey);
}
$applicantRoleIDs = static::getDefaultRoles(self::TYPE_APPLICANT);
$Count = Gdn::cache()->get($CacheKey);
if ($Count === Gdn_Cache::CACHEOP_FAILURE) {
$Count = Gdn::sql()->select('u.UserID', 'count', 'UserCount')->from('User u')->join('UserRole ur', 'u.UserID = ur.UserID')->where('ur.RoleID', $applicantRoleIDs)->where('u.Deleted', '0')->get()->value('UserCount', 0);
Gdn::cache()->store($CacheKey, $Count, array(Gdn_Cache::FEATURE_EXPIRY => 300));
}
return $Count;
}