AlligatorCurrencyExtension
class AlligatorCurrencyExtension extends Twig_Extension
Class AlligatorCurrencyExtension is injected as twig.extension.alligator.currency service. AlligatorCurrencyExtension handles the logic and provides necessary data for managed entity in twig.
Properties
| protected CurrencyFormatter | $currencyFormatter | ||
| protected CurrencyManager | $currencyManager |
Methods
AlligatorCurrencyExtension constructor.
{@inheritDoc}
{@inheritdoc}
Converts the given Money object into another currency and returns a new Money object
Converts the given JSON object into another currency and returns a new Money object
Ger array of all currency signs
Get currency sign for specified currency name
Formats the given Money object INCLUDING the currency symbol
Formats the given Money object INCLUDING the currency symbol
Format money for given currency
Formats the given Money object INCLUDING the currency symbol
Format number
Convert money to number
Get currency base on current users pricelist
Get currency ration
{@inheritDoc}
Details
at line 43
__construct(CurrencyFormatter $currencyFormatter, CurrencyManager $currencyManager, UserSettingsManager $userSettingsManager)
AlligatorCurrencyExtension constructor.
at line 53
getFilters()
{@inheritDoc}
at line 70
getFunctions()
{@inheritdoc}
at line 91
Money
convert(Money $money, string $currencyCode, null $currencyRatio = null)
Converts the given Money object into another currency and returns a new Money object
at line 106
Money
convertJSON(mixed $money, string $currencyCode = null, null $currencyRatio = null, bool $toDefault = false)
Converts the given JSON object into another currency and returns a new Money object
at line 138
array
getAllCurrencySign()
Ger array of all currency signs
at line 149
string|null
getCurrencySymbol(string $currencyString)
Get currency sign for specified currency name
at line 167
string
formatCurrencyJSON(mixed $price, mixed $code)
Formats the given Money object INCLUDING the currency symbol
at line 181
string
formatMoney(mixed $money, null $currencySting = null, string $decPoint = ',', string $thousandsSep = ' ')
Formats the given Money object INCLUDING the currency symbol
at line 204
string
formatMoneyWithCurrency(mixed $money, mixed $currency = SessionParamListener::CURRENCY_DEFAULT_MONEY)
Format money for given currency
at line 224
string
onlyFormatMoney(mixed $money, string $decPoint = ',', string $thousandsSep = '.')
Formats the given Money object INCLUDING the currency symbol
at line 247
string
formatNumber(string $number, string $decPoint = ',', string $thousandsSep = '.')
Format number
at line 262
float|int|Money
convertMoneyToNumber(mixed $money, mixed $currencyCode)
Convert money to number
at line 277
string|null
getUserPriceListCurrency()
Get currency base on current users pricelist
at line 292
mixed
getCurrencyRatioByCode(string $code)
Get currency ration
at line 306
getName()
{@inheritDoc}