Function __global->points_transact
Definitions
sources/points2.php
- Transact points from one member to another. This uses gift points where possible and if enabled.
- 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 ID of the member sending the points |
| $receiving_member | MEMBER | No | No | required parameter | N/A | N/A | The ID of the member receiving the points |
| $reason | SHORT_TEXT | No | No | required parameter | N/A | N/A | The reason for this transaction in the logs |
| $total_points | integer | No | No | required parameter | N/A | N/A | The total number of points to transact (includes gift points when applicable) |
| $amount_gift_points | ?integer | No | No | Null | N/A | N/A | The strict number of $total_points which should come from the sender's gift points balance (null: use as many gift points the sender has available) |
| $anonymous | BINARY | No | No | 0 | N/A | N/A | Whether the sender should be hidden from those without the privilege to trace anonymous transactions |
| $send_notifications | ?boolean | No | No | True | N/A | N/A | Whether to send notifications for this transaction (false: only the staff get it) (true: both the member and staff get it) (null: neither the member nor staff get it) |
| $locked | BINARY | No | No | 0 | N/A | N/A | Whether this transaction is irreversible |
| $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) |
| $force | boolean | No | No | False | N/A | N/A | Whether to force this transaction to occur even if the sender does not have enough points |
| $is_ranked | boolean | No | No | True | 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 transaction (null: a transaction was not created)
- Type: ?AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Transact points from one member to another. This uses gift points where possible and if enabled.
*
* @param MEMBER $sending_member The ID of the member sending the points
* @param MEMBER $receiving_member The ID of the member receiving the points
* @param SHORT_TEXT $reason The reason for this transaction in the logs
* @param integer $total_points The total number of points to transact (includes gift points when applicable)
* @param ?integer $amount_gift_points The strict number of $total_points which should come from the sender's gift points balance (null: use as many gift points the sender has available)
* @param BINARY $anonymous Whether the sender should be hidden from those without the privilege to trace anonymous transactions
* @param ?boolean $send_notifications Whether to send notifications for this transaction (false: only the staff get it) (true: both the member and staff get it) (null: neither the member nor staff get it)
* @param BINARY $locked Whether this transaction is irreversible
* @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 boolean $force Whether to force this transaction to occur even if the sender does not have enough points
* @param boolean $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 transaction (null: a transaction was not created)
*/
function points_transact(int $sending_member, int $receiving_member, string $reason, int $total_points, ?int $amount_gift_points = null, int $anonymous = 0, ?bool $send_notifications = true, int $locked = 0, string $t_type = '', string $t_subtype = '', string $t_type_id = '', ?int $time = null, bool $force = false, bool $is_ranked = true) : ?int
* Transact points from one member to another. This uses gift points where possible and if enabled.
*
* @param MEMBER $sending_member The ID of the member sending the points
* @param MEMBER $receiving_member The ID of the member receiving the points
* @param SHORT_TEXT $reason The reason for this transaction in the logs
* @param integer $total_points The total number of points to transact (includes gift points when applicable)
* @param ?integer $amount_gift_points The strict number of $total_points which should come from the sender's gift points balance (null: use as many gift points the sender has available)
* @param BINARY $anonymous Whether the sender should be hidden from those without the privilege to trace anonymous transactions
* @param ?boolean $send_notifications Whether to send notifications for this transaction (false: only the staff get it) (true: both the member and staff get it) (null: neither the member nor staff get it)
* @param BINARY $locked Whether this transaction is irreversible
* @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 boolean $force Whether to force this transaction to occur even if the sender does not have enough points
* @param boolean $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 transaction (null: a transaction was not created)
*/
function points_transact(int $sending_member, int $receiving_member, string $reason, int $total_points, ?int $amount_gift_points = null, int $anonymous = 0, ?bool $send_notifications = true, int $locked = 0, string $t_type = '', string $t_subtype = '', string $t_type_id = '', ?int $time = null, bool $force = false, bool $is_ranked = true) : ?int

