UserModel::givePointsInternal PHP Method

givePointsInternal() private static method

Add points to a user's total in a specific time slot.
See also: UserModel::GivePoints()
Since: 2.1.0
private static givePointsInternal ( integer $UserID, integer $Points, string $SlotType, string $Source = 'Total', integer $CategoryID, integer | false $Timestamp = false )
$UserID integer
$Points integer
$SlotType string
$Source string
$CategoryID integer
$Timestamp integer | false
    private static function givePointsInternal($UserID, $Points, $SlotType, $Source = 'Total', $CategoryID = 0, $Timestamp = false)
    {
        $TimeSlot = gmdate('Y-m-d', Gdn_Statistics::timeSlotStamp($SlotType, $Timestamp));
        $Px = Gdn::database()->DatabasePrefix;
        $Sql = "insert {$Px}UserPoints (UserID, SlotType, TimeSlot, Source, CategoryID, Points)\n         values (:UserID, :SlotType, :TimeSlot, :Source, :CategoryID, :Points)\n         on duplicate key update Points = Points + :Points1";
        Gdn::database()->query($Sql, [':UserID' => $UserID, ':Points' => $Points, ':SlotType' => $SlotType, ':Source' => $Source, ':CategoryID' => $CategoryID, ':TimeSlot' => $TimeSlot, ':Points1' => $Points]);
    }
UserModel