Skip to content

Instantly share code, notes, and snippets.

@mysiar
Created September 12, 2020 15:07
Show Gist options
  • Save mysiar/266fc3f9b7123f9ce476c405a70f4c32 to your computer and use it in GitHub Desktop.
Save mysiar/266fc3f9b7123f9ce476c405a70f4c32 to your computer and use it in GitHub Desktop.
Amount Embeddable
/**
* @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