Function __global->points_ledger_calculate
Definitions
sources/points.php
- This is a low-level function to calculate the number of points directly from the ledger for the given criteria.This function accounts (adjusts) for reversed and refunded transactions as well.
- Is abstract?: No
- Is static?: No
- Is final?: No
- Return: array
Parameters
Name | Type | Default | Set | Range | Description |
---|---|---|---|---|---|
$types | integer | required parameter | N/A | N/A | The calculations we want to return (see LEDGER_TYPE_*) |
$primary_member | MEMBER | required parameter | N/A | N/A | The member to calculate (received: The member receiving the points) (sent and spent: the member using the points) |
$secondary_member | ?MEMBER | Null | N/A | N/A | Optionally filter to a secondary member (received: The member who sent the points to the primary member) (sent: The member who received the points from the primary member) (spent: always the system) (null: any member) |
$where | LONG_TEXT | Blank (empty string) | N/A | N/A | Optionally add additional WHERE to the SQL (should start with ' AND') |
Return
- Map; key is a type based on $types, value is the tuple of [count of active transactions matching criteria, number of points, number of gift points]
- Type: array
- Set: N/A
- Range: N/A