. */ declare(strict_types=1); namespace FireflyIII\Transformers; use FireflyIII\Models\TransactionCurrency; /** * Class CurrencyTransformer */ class CurrencyTransformer extends AbstractTransformer { /** * Transform the currency. */ public function transform(TransactionCurrency $currency): array { return [ 'id' => $currency->id, 'created_at' => $currency->created_at->toAtomString(), 'updated_at' => $currency->updated_at->toAtomString(), 'default' => $currency->userGroupDefault, 'enabled' => $currency->userGroupEnabled, 'name' => $currency->name, 'code' => $currency->code, 'symbol' => $currency->symbol, 'decimal_places' => $currency->decimal_places, 'links' => [ [ 'rel' => 'self', 'uri' => '/currencies/'.$currency->id, ], ], ]; } }