rency_symbol( $this->code ); } /** * Retrieves the currency's symbol position from Localization Service * * @return string Currency position (left/right). */ public function get_symbol_position(): string { return $this->localization_service->get_currency_format( $this->code )['currency_pos']; } /** * Retrieves if the currency is zero decimal. * * @return bool */ public function get_is_zero_decimal(): bool { return $this->is_zero_decimal; } /** * Get the timestamp reprenting when the currency was last updated. * * @return int|null A timestamp representing when the currency was last updated. */ public function get_last_updated() { return $this->last_updated; } /** * Sets the currency's charm rate. * * @param float $charm Charm rate. */ public function set_charm( $charm ) { $this->charm = $charm; } /** * Sets the currency's conversion rate. * * @param float $rate Conversion rate. */ public function set_rate( $rate ) { $this->rate = $rate; } /** * Sets the currency's rounding rate. * * @param string $rounding Rounding rate. * @return void */ public function set_rounding( $rounding ) { $this->rounding = $rounding; } /** * Set the currency's last updated timestamp. * * @param int $last_updated A timestamp representing when the currency was last updated. * * @return void */ public function set_last_updated( int $last_updated ) { $this->last_updated = $last_updated; } /** * Specify the data that should be serialized to JSON. * * @return array Serialized Currency object. */ public function jsonSerialize(): array { return [ 'code' => $this->code, 'rate' => $this->get_rate(), 'name' => html_entity_decode( $this->get_name() ), 'id' => $this->get_id(), 'is_default' => $this->get_is_default(), 'flag' => $this->get_flag(), 'symbol' => html_entity_decode( $this->get_symbol() ), 'symbol_position' => $this->get_symbol_position(), 'is_zero_decimal' => $this->get_is_zero_decimal(), 'last_updated' => $this->get_last_updated(), ]; } }