Kevin Carwile

Points PHP API: Get A Member's Net Worth


The following api method can be used to obtain the net worth value of a member for a particular currency.

Get A Member's Net Worth

class \IPS\points\Currency

/**
* Get net worth as of a certain date/time
*
* @param	\IPS\DateTime		$date			The date/time to retrieve the balance for
* @param	\IPS\Member		$member			The member to retrieve the balance for
* @return	int|float
*/
public function netWorthAsOf( \IPS\DateTime $date=NULL, \IPS\Member $member=NULL );

Example:

/* Load a currency */
$currency = \IPS\points\Currency::load( 1 );

/* Load a member */
$member = \IPS\Member::load( 1 );

/* Get the current net worth of the member for the currency */
$worth = $currency->netWorthAsOf( new \IPS\DateTime( 'now' ), $member );

 


  • Like 2
  Report Article


User Feedback


There are no comments to display.