22 lines
332 B
PHP
22 lines
332 B
PHP
|
<?php
|
||
|
|
||
|
namespace CameraBundle\ValueObject;
|
||
|
|
||
|
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();
|
||
|
}
|
||
|
}
|