Function __global->_points_transact
Definitions
sources/points2.php
- Actualisation for processing the points transaction and putting it into the ledger.This adds the points transaction into the ledger (officiating the points transaction) and re-calculates points CPFs and cache.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $sending_member | MEMBER | No | No | required parameter | N/A | N/A | The member sending the points (use guest ID for a credit from the system) |
| $receiving_member | MEMBER | No | No | required parameter | N/A | N/A | The member receiving the points (use guest ID for a debit to the system) |
| $reason | SHORT_TEXT | No | No | required parameter | N/A | N/A | The reason for this transaction used in the logs |
| $amount_points | integer | No | No | required parameter | N/A | N/A | Number of regular points transacted (does not include gift points) |
| $amount_gift_points | integer | No | No | required parameter | N/A | N/A | Number of gift points transacted |
| $anonymous | BINARY | No | No | 0 | N/A | N/A | Whether the sending_member for this transaction should be hidden |
| $status | integer | No | No | 0 | N/A | N/A | The status of this transaction (see LEDGER_STATUS_*) |
| $locked | BINARY | No | No | 0 | N/A | N/A | Whether this transaction is irreversible |
| $linked_ledger | ?array | No | No | Null | N/A | N/A | The database row of the points_ledger this one relates to (null: does not relate to another ledger) |
| $t_type | ID_TEXT | No | No | Blank (empty string) | N/A | N/A | An identifier to relate this transaction with other transactions of the same $type (e.g. content type) |
| $t_subtype | ID_TEXT | No | No | Blank (empty string) | N/A | N/A | An identifier to relate this transaction with other transactions of the same $type and $subtype (e.g. an action performed on the $type) |
| $t_type_id | ID_TEXT | No | No | Blank (empty string) | N/A | N/A | Some content or row ID of the specified $type |
| $time | ?TIME | No | No | Null | N/A | N/A | The time this transaction occurred (null: now) |
| $is_ranked | BINARY | No | No | 1 | N/A | N/A | Whether the points should affect rank points for the sending member if a debit, else the reciving member |
Returns
- The ID of the point transaction in the ledger
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Actualisation for processing the points transaction and putting it into the ledger.This adds the points transaction into the ledger (officiating the points transaction) and re-calculates points CPFs and cache.
*
* @param MEMBER $sending_member The member sending the points (use guest ID for a credit from the system)
* @param MEMBER $receiving_member The member receiving the points (use guest ID for a debit to the system)
* @param SHORT_TEXT $reason The reason for this transaction used in the logs
* @param integer $amount_points Number of regular points transacted (does not include gift points)
* @param integer $amount_gift_points Number of gift points transacted
* @param BINARY $anonymous Whether the sending_member for this transaction should be hidden
* @param integer $status The status of this transaction (see LEDGER_STATUS_*)
* @param BINARY $locked Whether this transaction is irreversible
* @param ?array $linked_ledger The database row of the points_ledger this one relates to (null: does not relate to another ledger)
* @param ID_TEXT $t_type An identifier to relate this transaction with other transactions of the same $type (e.g. content type)
* @param ID_TEXT $t_subtype An identifier to relate this transaction with other transactions of the same $type and $subtype (e.g. an action performed on the $type)
* @param ID_TEXT $t_type_id Some content or row ID of the specified $type
* @param ?TIME $time The time this transaction occurred (null: now)
* @param BINARY $is_ranked Whether the points should affect rank points for the sending member if a debit, else the reciving member
* @return AUTO_LINK The ID of the point transaction in the ledger
*/
function _points_transact(int $sending_member, int $receiving_member, string $reason, int $amount_points, int $amount_gift_points, int $anonymous = 0, int $status = 0, int $locked = 0, ?array $linked_ledger = null, string $t_type = '', string $t_subtype = '', string $t_type_id = '', ?int $time = null, int $is_ranked = 1) : int
* Actualisation for processing the points transaction and putting it into the ledger.This adds the points transaction into the ledger (officiating the points transaction) and re-calculates points CPFs and cache.
*
* @param MEMBER $sending_member The member sending the points (use guest ID for a credit from the system)
* @param MEMBER $receiving_member The member receiving the points (use guest ID for a debit to the system)
* @param SHORT_TEXT $reason The reason for this transaction used in the logs
* @param integer $amount_points Number of regular points transacted (does not include gift points)
* @param integer $amount_gift_points Number of gift points transacted
* @param BINARY $anonymous Whether the sending_member for this transaction should be hidden
* @param integer $status The status of this transaction (see LEDGER_STATUS_*)
* @param BINARY $locked Whether this transaction is irreversible
* @param ?array $linked_ledger The database row of the points_ledger this one relates to (null: does not relate to another ledger)
* @param ID_TEXT $t_type An identifier to relate this transaction with other transactions of the same $type (e.g. content type)
* @param ID_TEXT $t_subtype An identifier to relate this transaction with other transactions of the same $type and $subtype (e.g. an action performed on the $type)
* @param ID_TEXT $t_type_id Some content or row ID of the specified $type
* @param ?TIME $time The time this transaction occurred (null: now)
* @param BINARY $is_ranked Whether the points should affect rank points for the sending member if a debit, else the reciving member
* @return AUTO_LINK The ID of the point transaction in the ledger
*/
function _points_transact(int $sending_member, int $receiving_member, string $reason, int $amount_points, int $amount_gift_points, int $anonymous = 0, int $status = 0, int $locked = 0, ?array $linked_ledger = null, string $t_type = '', string $t_subtype = '', string $t_type_id = '', ?int $time = null, int $is_ranked = 1) : int

