Function __global->_points_transact_calculate

Definitions

sources/points2.php

  • Calculate how many points will be transacted from the sender to the recipient.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

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
$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 (null: use what gift points the sender has available)
$force boolean No No False N/A N/A Whether this transaction is being forced (true: this function will never return null)

Returns

  • Duple containing the number of regular points (key 0) and number of gift points (key 1) that should be transacted from the sender (null: not enough points to satisfy the conditions specified)
  • Type: ?array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Calculate how many points will be transacted from the sender to the recipient.
 *
 * @param  MEMBER $sending_member The ID of the member sending the points
 * @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 (null: use what gift points the sender has available)
 * @param  boolean $force Whether this transaction is being forced (true: this function will never return null)
 * @return ?array Duple containing the number of regular points (key 0) and number of gift points (key 1) that should be transacted from the sender (null: not enough points to satisfy the conditions specified)
 */

function _points_transact_calculate(int $sending_member, int $total_points, ?int $amount_gift_points = null, bool $force = false) : ?array