Clanbite Points

class Ledger

CRUD helpers for the points ledger table.

class final

Full name
Kernowdev\ClanbitePoints\Points\Ledger

Methods

  • count_since_gmt() Number of times an action was rewarded for a user/type since a GMT datetime (inclusive).
  • get_live_rows_for_ref() Live awards for a reference and everything beneath it (sk_post:34 also matches sk_post:34:comment:9).
  • has_any() Whether any ledger row exists for this user/type/action (lifetime).
  • has_live_ref() Whether a live (not reversed) award with this reference exists.
  • insert_reversal() Insert the negative row that takes back a reversed award.
  • insert() Insert a ledger row and return its ID.
  • mark_reversed() Mark an award as reversed. Only the first caller succeeds, so an award is never taken back twice.
  • sum_since_gmt() Sum of points awarded for a user/type/action since a GMT datetime (inclusive).

Defined in inc/Points/Ledger.php

Changelog

VersionDescription
1.4.0Updated.
1.1.0Updated.