mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 01:45:22 +00:00
Introduce missing methods
This commit is contained in:
@@ -173,6 +173,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
|
||||
/**
|
||||
* Get the user group's currencies.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function get(): Collection
|
||||
@@ -291,7 +292,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
*
|
||||
* @return TransactionCurrency|null
|
||||
*/
|
||||
private function findByCode(string $currencyCode): ?TransactionCurrency
|
||||
public function findByCode(string $currencyCode): ?TransactionCurrency
|
||||
{
|
||||
return TransactionCurrency::where('code', $currencyCode)->first();
|
||||
}
|
||||
@@ -307,6 +308,16 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
$currency->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getByIds(array $ids): Collection
|
||||
{
|
||||
return TransactionCurrency::orderBy('code', 'ASC')->whereIn('id', $ids)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -55,6 +55,13 @@ interface CurrencyRepositoryInterface
|
||||
*/
|
||||
public function find(int $currencyId): ?TransactionCurrency;
|
||||
|
||||
/**
|
||||
* @param string $currencyCode
|
||||
*
|
||||
* @return TransactionCurrency|null
|
||||
*/
|
||||
public function findByCode(string $currencyCode): ?TransactionCurrency;
|
||||
|
||||
/**
|
||||
* Find by object, ID or code. Returns user default or system default.
|
||||
*
|
||||
@@ -89,6 +96,13 @@ interface CurrencyRepositoryInterface
|
||||
*/
|
||||
public function getAll(): Collection;
|
||||
|
||||
/**
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getByIds(array $ids): Collection;
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user