. */ declare(strict_types=1); namespace FireflyIII\Transformers\V2; use FireflyIII\Models\TransactionCurrency; use Illuminate\Support\Collection; /** * Class CurrencyTransformer */ class CurrencyTransformer extends AbstractTransformer { public function collectMetaData(Collection $objects): Collection { return $objects; } /** * 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(), 'native' => $currency->userGroupNative, 'enabled' => $currency->userGroupEnabled, 'name' => $currency->name, 'code' => $currency->code, 'symbol' => $currency->symbol, 'decimal_places' => $currency->decimal_places, 'links' => [ [ 'rel' => 'self', 'uri' => '/currencies/'.$currency->id, ], ], ]; } }