2017-11-22 13:51:04 -05:00
|
|
|
<?php
|
|
|
|
|
2018-02-14 16:42:39 -05:00
|
|
|
namespace App\ValueObject;
|
2017-11-22 13:51:04 -05:00
|
|
|
|
|
|
|
class Money {
|
|
|
|
private $value;
|
|
|
|
|
|
|
|
public function __construct($value)
|
|
|
|
{
|
|
|
|
$this->value = str_replace(['$',','], '', $value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getValue()
|
|
|
|
{
|
|
|
|
return str_replace(['$',','], '', $this->value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __toString()
|
|
|
|
{
|
|
|
|
return (string)$this->getValue();
|
|
|
|
}
|
2018-02-14 16:42:39 -05:00
|
|
|
}
|