mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Mark as deprecated.
This commit is contained in:
@@ -31,10 +31,27 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class ExchangeRateRepository
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
{
|
||||
use UserGroupTrait;
|
||||
|
||||
#[\Override]
|
||||
public function deleteRate(CurrencyExchangeRate $rate): void
|
||||
{
|
||||
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAll(): Collection
|
||||
{
|
||||
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
||||
{
|
||||
@@ -71,24 +88,6 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function deleteRate(CurrencyExchangeRate $rate): void
|
||||
{
|
||||
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
||||
{
|
||||
$object->rate = $rate;
|
||||
if (null !== $date) {
|
||||
$object->date = $date;
|
||||
}
|
||||
$object->save();
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function storeExchangeRate(TransactionCurrency $from, TransactionCurrency $to, string $rate, Carbon $date): CurrencyExchangeRate
|
||||
{
|
||||
@@ -106,8 +105,14 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAll(): Collection
|
||||
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
||||
{
|
||||
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
||||
$object->rate = $rate;
|
||||
if (null !== $date) {
|
||||
$object->date = $date;
|
||||
}
|
||||
$object->save();
|
||||
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user