collection-crud/src/ValueObject/Money.php

22 lines
332 B
PHP
Raw Normal View History

<?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();
}
}