Updated Currency

This commit is contained in:
netkas 2024-10-04 15:03:36 -04:00
parent 1aec926fd6
commit 3eae8f43c8

View file

@ -7,60 +7,17 @@
class Currency implements ObjectTypeInterface class Currency implements ObjectTypeInterface
{ {
/** private string $code;
* @var string private string $title;
*/ private string $symbol;
private $code; private string $native;
private string $thousands_sep;
/** private string $decimal_sep;
* @var string private bool $symbol_left;
*/ private bool $space_between;
private $title; private int $exp;
private string $min_amount;
/** private string $max_amount;
* @var string
*/
private $symbol;
/**
* @var string
*/
private $native;
/**
* @var string
*/
private $thousands_sep;
/**
* @var string
*/
private $decimal_sep;
/**
* @var bool
*/
private $symbol_left;
/**
* @var bool
*/
private $space_between;
/**
* @var int
*/
private $exp;
/**
* @var string
*/
private $min_amount;
/**
* @var string
*/
private $max_amount;
/** /**
* @return string * @return string
@ -151,9 +108,7 @@
} }
/** /**
* Returns an array representation of the object * @inheritDoc
*
* @return array
*/ */
public function toArray(): array public function toArray(): array
{ {
@ -173,15 +128,16 @@
} }
/** /**
* Constructs the object from an array representation * @inheritDoc
*
* @param array $data
* @return ObjectTypeInterface
*/ */
public static function fromArray(array $data): ObjectTypeInterface public static function fromArray(?array $data): ?Currency
{ {
$object = new self(); if($data === null)
{
return null;
}
$object = new self();
$object->code = $data['code'] ?? null; $object->code = $data['code'] ?? null;
$object->title = $data['title'] ?? null; $object->title = $data['title'] ?? null;
$object->symbol = $data['symbol'] ?? null; $object->symbol = $data['symbol'] ?? null;