class CurrencyRepository extends EntityRepository

Class CurrencyRepository is injected as alligator.currency_repository service. CurrencyRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

ALIAS

Alias for main entity

Properties

protected array $ratioList Array for caching ratios from database

Methods

jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

array
getRatioList(bool $force = false)

Get ratio list from database

saveNewCurrency(RatioStorage $ratioStorage)

Persist new Currency

removeCurrenciesFromCache()

Remove all currency data from cache

bool
changeCurrentDefaultCurrency()

Set isDefault param to false to default currency

bool
updateCurrencyToNewDefault(double $defaultRatio)

Update currency ratio for all currencies

editCurrency(RatioStorage $ratioStorage)

Merge Currency

bool
deleteCurrencies(array $currenciesDB)

Delete multiple currencies

array
getCurrenciesArray(array $array)

Get multiple currencies from database

array
getAutoCalculatedCurrencies()

Get all currencies that are auto calculated

boolean
updateAutoCalculatedCurrencies(array $currencies)

Update multiple auto calculated currencies

array
getDefaultCurrencyEntity()

Get default currency

bool
updateCurrencyRatioOnly(string $currencyName, double $value)

Update currency ratio for specified currency name

RatioStorage|bool|Proxy|null|object
getReference(int $id)

Find ratio storage reference by id

Details

in JQGridTrait at line 27
jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 42
jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 61
array findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

in JQGridTrait at line 94
array searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Parameters

array $searchParams
array $sortParams
bool $isCountSearch
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

at line 45
array getRatioList(bool $force = false)

Get ratio list from database

Parameters

bool $force
  • force data load from database

Return Value

array

at line 74
RatioStorage saveNewCurrency(RatioStorage $ratioStorage)

Persist new Currency

Parameters

RatioStorage $ratioStorage

Return Value

RatioStorage

at line 93
removeCurrenciesFromCache()

Remove all currency data from cache

at line 103
bool changeCurrentDefaultCurrency()

Set isDefault param to false to default currency

Return Value

bool

at line 129
bool updateCurrencyToNewDefault(double $defaultRatio)

Update currency ratio for all currencies

Parameters

double $defaultRatio

Return Value

bool

at line 150
RatioStorage editCurrency(RatioStorage $ratioStorage)

Merge Currency

Parameters

RatioStorage $ratioStorage

Return Value

RatioStorage

at line 175
bool deleteCurrencies(array $currenciesDB)

Delete multiple currencies

Parameters

array $currenciesDB

Return Value

bool

Exceptions

ORMException
OptimisticLockException

at line 196
array getCurrenciesArray(array $array)

Get multiple currencies from database

Parameters

array $array

Return Value

array

at line 212
array getAutoCalculatedCurrencies()

Get all currencies that are auto calculated

Return Value

array

at line 228
boolean updateAutoCalculatedCurrencies(array $currencies)

Update multiple auto calculated currencies

Parameters

array $currencies

Return Value

boolean

at line 256
array getDefaultCurrencyEntity()

Get default currency

Return Value

array

Exceptions

NoResultException
NonUniqueResultException

at line 270
bool updateCurrencyRatioOnly(string $currencyName, double $value)

Update currency ratio for specified currency name

Parameters

string $currencyName
double $value

Return Value

bool

at line 296
RatioStorage|bool|Proxy|null|object getReference(int $id)

Find ratio storage reference by id

Parameters

int $id

Return Value

RatioStorage|bool|Proxy|null|object

Exceptions

ORMException