\apex\transactiontx_account

Handles all aspects of an individual transaction account, such as get balance, freeze funds, update balance, etc.

Summary

Methods
Properties
Constants
__construct()
get_id()
create()
lookup()
load()
get_extra()
set_user()
get_balance()
get_available_balance()
get_pending()
get_frozen()
get_userid()
get_currency()
get_delayed_sends()
get_reqsigs()
get_label()
update_balance()
toArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$user
$account_id
$userid
$currency
$balance
$pending
$frozen
$delayed_sends
$reqsigs
$label
$acct_row
$extra
N/A

Properties

$user

$user :\apex\users\user

Type

\apex\users\user

$account_id

$account_id :

Type

$userid

$userid :

Type

$currency

$currency :

Type

$balance

$balance :

Type

$pending

$pending :

Type

$frozen

$frozen :

Type

$delayed_sends

$delayed_sends :

Type

$reqsigs

$reqsigs :

Type

$label

$label :

Type

$acct_row

$acct_row :

Type

$extra

$extra :

Type

Methods

__construct()

__construct(\apex\transaction\int  $id)

Construct.

Parameters

\apex\transaction\int $id

get_id()

get_id(): integer

Get account ID

Returns

integer —

the unqiue ID# of the transaction account.

create()

create(string  $currency,string  $label = '',integer  $delayed_sends,integer  $reqsigs)

Create transaction account.

Parameters

string $currency

The currency of the account to create.

string $label

Optional label for the account.

integer $delayed_sends

Number of minutes to delay sends from account.

integer $reqsigs

Number of signatures required for sends.

lookup()

lookup(string  $currency = '')

Lookup account based on userid and currency.

Parameters

string $currency

The currency of the account to lookup.

load()

load()

Load the transaction account.

get_extra()

get_extra(string  $package): mixed

Get extra account data.

Parameters

string $package

The package alias of the account vars to return.

Returns

mixed —

The contents of the extra account vars.

set_user()

set_user(integer  $userid)

Set the user

Parameters

integer $userid

The id# of the user

get_balance()

get_balance(): float

Get account balance

Returns

float —

The account balance.

get_available_balance()

get_available_balance(): float

Get available balance.

Returns

float —

The available balance of the account.

get_pending()

get_pending(): float

Get pendinb alance.

Returns

float —

The current sum of pending transactions.

get_frozen()

get_frozen(): float

Get frozen balance.

Returns

float —

The sum of frozen transactions on the account.

get_userid()

get_userid(): integer

Get userid of account

Returns

integer —

The userid of the account holder.

get_currency()

get_currency(): string

Get account currency.

Returns

string —

The account currency.

get_delayed_sends()

get_delayed_sends(): integer

Get delayed sends.

Returns

integer —

The delayed sends of the account.

get_reqsigs()

get_reqsigs(): integer

Get reqsigs

Returns

integer —

The reqsigs of the account.

get_label()

get_label(): string

Get label of account

Returns

string —

The label / name of the transaction account.

update_balance()

update_balance(\apex\transaction\interfaces\TxInterface  $tx,string  $new_status = '',float  $diff_amount)

Update the account balance.

Parameters

\apex\transaction\interfaces\TxInterface $tx

The transaction object.

string $new_status

The new status of the tx, if it is being modified.

float $diff_amount

The differential amount to update balance with. Only used when modifying the tx amount via admin panel.

toArray()

toArray(): array

Return array of raw account info.

Returns

array —

The raw database row of the transaction account.