public function reduceInviteCount($UserID, $ReduceBy = 1)
{
$CurrentCount = $this->getInvitationCount($UserID);
// Do not reduce if the user has unlimited invitations
if ($CurrentCount == -1) {
return true;
}
// Do not reduce the count below zero.
if ($ReduceBy > $CurrentCount) {
$ReduceBy = $CurrentCount;
}
$this->SQL->update($this->Name)->set('CountInvitations', 'CountInvitations - ' . $ReduceBy, false)->where('UserID', $UserID)->put();
}