ZurmoCurrencyHelper Class Reference

Public Member Functions

 setBaseCode ($value)
 getBaseCode ()
 setServiceType ($value)
 getServiceType ()
 getActiveCurrencyForCurrentUser ()
 getCodeForCurrentUserForDisplay ()
 getConversionRateToBase ($fromCode)
 getWebServiceErrorMessage ()
 getWebServiceErrorCode ()
 checkAndUpdateCurrencyRates ($forceCheck=false)
 getActiveCurrenciesOrSelectedCurrenciesData ($selectedCurrencyId)
 getLastAttemptedRateUpdateDateTime ()
 resetErrors ()

Data Fields

const ERROR_INVALID_CODE = 1
const ERROR_WEB_SERVICE = 2

Protected Member Functions

 setCurrencyService ()

Protected Attributes

 $_baseCode
 $_serviceType
 $currencyService

Detailed Description

Application loaded component at run time.

See also:
BeginBehavior - calls load() method.

Definition at line 40 of file ZurmoCurrencyHelper.php.


Member Function Documentation

setBaseCode ( value  ) 

This is set from the value in the application common config file.

Definition at line 68 of file ZurmoCurrencyHelper.php.

setServiceType ( value  ) 

This is set from the value in the application common config file.

Definition at line 82 of file ZurmoCurrencyHelper.php.

getActiveCurrencyForCurrentUser (  ) 

Resolve the active currency for the current user. If the user does not have a currency, it will fall back to the base system currency. If the base system currency does not exist, it will attempt to make it.

Exceptions:
NotSupportedException 

Definition at line 106 of file ZurmoCurrencyHelper.php.

getConversionRateToBase ( fromCode  ) 

Get the conversion rate from the supplied currency code to the base currency.

Parameters:
int $fromCode;

Definition at line 147 of file ZurmoCurrencyHelper.php.

checkAndUpdateCurrencyRates ( forceCheck = false  ) 

Check if the currency rate has been updated within the last 24 hours. If not, then perform a currency update and update the lastAttemptedRateUpdateTimeStamp.

Parameters:
boolean $forceCheck - If true, it will ignore the last time the check was made

Definition at line 176 of file ZurmoCurrencyHelper.php.

getActiveCurrenciesOrSelectedCurrenciesData ( selectedCurrencyId  ) 

Given a selectedCurrencyId, return an array of available currencies for selection in the user interface. If the selected currency is inactive, include this in the returned data.

Parameters:
mixed $selectedCurrencyId

Definition at line 204 of file ZurmoCurrencyHelper.php.

getLastAttemptedRateUpdateDateTime (  ) 
Returns:
Date/Time of the last attempted rate update.

Definition at line 226 of file ZurmoCurrencyHelper.php.


Field Documentation

$_baseCode [protected]

Base currency all currency values have rates against. ISO-4217 code.

Definition at line 50 of file ZurmoCurrencyHelper.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sat Jun 24 07:10:30 2017