Returns total number of users who are expected to accept site policy

@return int|null
170474
public static function count_total_users() {
        global $DB, $CFG;
        static $cached = null;
        if ($cached === null) {
            $cached = $DB->count_records_select('user', 'deleted = 0 AND id <> ?', [$CFG->siteguest]);
        }
        return $cached;
    }
515740
public function isGuestAllowed()
    {
        if (null === $user = $this['repo.users']->findByLogin(User::USER_GUEST)) {
            return false;
        }

        return count($this->getAclForUser($user)->get_granted_base()) > 0;
    }
315726
static function roleCount( $ignoreNew = true )
    {
        $conds = array( 'version' => 0 );
        if ( $ignoreNew === true )
        {
            $conds['is_new'] = 0;
        }
        return eZPersistentObject::count( eZRole::definition(), $conds );
    }
1190330
function count()
    {
        $count = 0;
        if (!empty($this->ldap_result)) {
            $count = $this->ldap_result['count'];
        }
        else if ($this->group_id && $this->group_data['dn']) {
            $count = count($this->list_group_members($this->group_data['dn'], true));
        }
        // We have a connection but no result set, attempt to get one.
        else if ($this->ready) {
            $count = $this->extended_search(true);
        }

        return new rcube_result_set($count, ($this->list_page-1) * $this->page_size);
    }
191145
public function getCount () {
        if ($this->_count === null) {
            if ($this->name === null) {
                throw new InvalidConfigException(get_class ($this) . " requires a name!");
            }
            $this->_count = (int)$this->getConnection ()->getSlave ()->lSize ($this->name);
        }
        return $this->_count;
    }
1094316
public function count()
    {
        return count($this->filter($this->menu[$this->getLang()], $this->_where, $this->_with));
    }
380159
function roleCount($UserID = null)
	{
		if ($UserID === null)
		    throw new \RbacUserNotProvidedException ("\$UserID is a required argument.");

		$Res = Jf::sql ( "SELECT COUNT(*) AS Result FROM {$this->tablePrefix()}userroles WHERE UserID=?", $UserID );
		return (int)$Res [0] ['Result'];
	}
1004353
public function stat_sites()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $response = $this->exec_curl('/api/stat/sites');

        return $this->process_response($response);
    }
981449
public function ApplicantCount() {
      $this->Permission('Garden.Users.Approve');
      $RoleModel = new RoleModel();
      $Count = $RoleModel->GetApplicantCount();
      if ($Count > 0)
         echo '<span class="Alert">', $Count, '</span>';
   }
819995
public function count()
    {
        if ($this->counterOwner instanceof ParamsHolder) {
            return $this->counterOwner->params[$this->counterParam];
        } else {
            return ArrayHelper::getValue($this->counterOwner, $this->counterParam, 0);
        }
    }
1081520
public function getPostCount($user_id)
    {
        /* Get count from forum posts */
        try {
            $posts = ForumPost::where('author_id', $user_id)->get();
            $posts = count($posts);
        } catch (Exception $e) {
            $posts = 0;
        }

        /* Get count from forum replies */
        try {
            $replies = ForumReply::where('author_id', $user_id)->get();
            $replies = count($replies);
        } catch (Exception $e) {
            $replies = 0;
        }

        /* Return total */
        return $posts + $replies;
    }
1033807
public function getCount()
	{
		if ( $this->empty ) return 0;

		if ( $this->src->getIsFinished() )
		{
			return count( $this->buffer );
		}
		return parent::getCount();
	}
1008934
public static function accept() {
        global $USER, $DB;

        if (!isloggedin()) {
            return false;
        }

        if ($USER->policyagreed) {
            return false;
        }

        if (isguestuser()) {
            // For guests, agreement is stored in the session only.
            $USER->policyagreed = 1;
            return true;
        }

        // Find all compulsory policies and mark them as accepted.
        $compulsory = [];
        foreach (api::list_current_versions(policy_version::AUDIENCE_LOGGEDIN) as $policyversion) {
            if ($policyversion->optional == policy_version::AGREEMENT_COMPULSORY) {
                $compulsory[] = $policyversion->id;
            }
        }

        if ($compulsory) {
            api::accept_policies($compulsory);
        }

        // Mark policies as agreed.
        $DB->set_field('user', 'policyagreed', 1, array('id' => $USER->id));
        $USER->policyagreed = 1;

        return true;
    }
1360550
private function getTotalCount(): int
    {
        if ($this->totalCount === -1) {
            $this->setTotalCount($this->getLastResponse()->getTotal());
        }

        return $this->totalCount;
    }
694380
public function getUserCount()
    {
        if ($this->_iUserCount === null) {
            $this->_iUserCount = 0;

            // load object
            $oNewsletter = oxNew(\OxidEsales\Eshop\Application\Model\Newsletter::class);
            if ($oNewsletter->load($this->getEditObjectId())) {
                // get nr. of users in these groups
                // we do not use lists here as we dont need this overhead right now
                $oDB = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
                $blSep = false;
                $sSelectGroups = " ( oxobject2group.oxgroupsid in ( ";

                // remove already added groups
                foreach ($oNewsletter->getGroups() as $oInGroup) {
                    if ($blSep) {
                        $sSelectGroups .= ",";
                    }
                    $sSelectGroups .= $oDB->quote($oInGroup->oxgroups__oxid->value);
                    $blSep = true;
                }

                $sSelectGroups .= " ) ) ";

                // no group selected
                if (!$blSep) {
                    $sSelectGroups = " oxobject2group.oxobjectid is null ";
                }
                $sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopID();
                $sQ = "select count(*) from ( select oxnewssubscribed.oxemail as _icnt from oxnewssubscribed left join
                   oxobject2group on oxobject2group.oxobjectid = oxnewssubscribed.oxuserid
                   where ( oxobject2group.oxshopid = '{$sShopId}'
                   or oxobject2group.oxshopid is null ) and {$sSelectGroups} and
                   oxnewssubscribed.oxdboptin = 1 and ( not ( oxnewssubscribed.oxemailfailed = '1') )
                   and (not(oxnewssubscribed.oxemailfailed = '1')) and oxnewssubscribed.oxshopid = '{$sShopId}'
                   group by oxnewssubscribed.oxemail ) as _tmp";

                // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
                $this->_iUserCount = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster()->getOne($sQ);
            }
        }

        return $this->_iUserCount;
    }
459096
public function getTokenCountUnanswered()
    {
        $tokenSelect = $this->tracker->getTokenSelect(new \Zend_Db_Expr('COUNT(*)'));
        $tokenSelect
                ->andReceptionCodes(array())
                ->andSurveys(array())
                ->andRounds(array())
                ->forRespondent($this->getRespondentId())
                ->forGroupId($this->getSurvey()->getGroupId())
                ->onlySucces()
                ->onlyValid()
                ->forWhere('gsu_active = 1')
                ->forWhere('gro_active = 1 OR gro_active IS NULL')
                ->withoutToken($this->_tokenId);

        $this->_addRelation($tokenSelect);

        return $tokenSelect->fetchOne();
    }
130974
public function getPagination()
    {
        $limit = $this->userManager->getUsersLimit();
        $count = $this->countVisibleUsers();
        $pages = $count / $limit;
        $remainder = $count % $limit;
        if ($remainder === 0) {
            return $pages;
        } else {
            return floor($pages) + 1;
        }
    }