Created
September 12, 2020 15:07
-
-
Save mysiar/266fc3f9b7123f9ce476c405a70f4c32 to your computer and use it in GitHub Desktop.
Amount Embeddable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @ORM\Embeddable() | |
*/ | |
class Amount | |
{ | |
/** | |
* @ORM\Column(type="integer") | |
* @var int | |
*/ | |
private $value; | |
/** | |
* @ORM\Column(type="integer") | |
* @var int | |
*/ | |
private $precision; | |
public function __construct(int $value, int $precision = 0) | |
{ | |
$this->value = $value; | |
$this->precision = $precision; | |
} | |
public function getValue(): int | |
{ | |
return $this->value; | |
} | |
public function getPrecision(): int | |
{ | |
return $this->precision; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment