src/Entity/System/Currency.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity(repositoryClass="App\Repository\System\CurrencyRepository")
  6. *
  7. * @ORM\Table(indexes={
  8. *
  9. * @ORM\Index(name="currency_iso_code", columns={"iso_code"})
  10. * })
  11. */
  12. class Currency
  13. {
  14. public const EURO_ISO_CODE = 'EUR';
  15. public const POUND_ISO_CODE = 'GBP';
  16. /**
  17. * @var int
  18. *
  19. * @ORM\Id
  20. *
  21. * @ORM\GeneratedValue()
  22. *
  23. * @ORM\Column(type="integer")
  24. */
  25. private $id;
  26. /**
  27. * @var string
  28. *
  29. * @ORM\Column(type="string", length=3, unique=true)
  30. */
  31. private $isoCode;
  32. /**
  33. * @ORM\Column(type="boolean", nullable=false)
  34. */
  35. private bool $active;
  36. /**
  37. * @ORM\Column(type="float", nullable=true)
  38. */
  39. private ?float $euroConversionRate;
  40. /**
  41. * @ORM\Column(type="string")
  42. */
  43. private string $name;
  44. public function __construct()
  45. {
  46. $this->active = false;
  47. }
  48. /**
  49. * @return int
  50. */
  51. public function getId(): int
  52. {
  53. return $this->id;
  54. }
  55. public function setId(int $id): self
  56. {
  57. $this->id = $id;
  58. return $this;
  59. }
  60. public function getIsoCode(): string
  61. {
  62. return $this->isoCode;
  63. }
  64. public function setIsoCode(string $isoCode): Currency
  65. {
  66. $this->isoCode = $isoCode;
  67. return $this;
  68. }
  69. public function isActive(): bool
  70. {
  71. return $this->active;
  72. }
  73. public function setActive(bool $active): Currency
  74. {
  75. $this->active = $active;
  76. return $this;
  77. }
  78. public function getEuroConversionRate(): ?float
  79. {
  80. return $this->euroConversionRate;
  81. }
  82. public function setEuroConversionRate(?float $euroConversionRate): Currency
  83. {
  84. $this->euroConversionRate = $euroConversionRate;
  85. return $this;
  86. }
  87. public function getName(): string
  88. {
  89. return $this->name;
  90. }
  91. public function setName(string $name): Currency
  92. {
  93. $this->name = $name;
  94. return $this;
  95. }
  96. }