You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
2.5KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Model\Config;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
  5. /**
  6. * @ORM\MappedSuperclass
  7. */
  8. abstract class UnitModel extends AbstractLightEntity implements UnitInterface
  9. {
  10. const UNIT_PERCENT = 'percent';
  11. const UNIT_AMOUNT = 'amount';
  12. public function getUnitAmountChoices(): array
  13. {
  14. return [
  15. self::UNIT_PERCENT,
  16. self::UNIT_AMOUNT,
  17. ];
  18. }
  19. /**
  20. * @ORM\Column(type="string", length=32)
  21. */
  22. protected $unit;
  23. /**
  24. * @ORM\Column(type="string", length=32)
  25. */
  26. protected $wording;
  27. /**
  28. * @ORM\Column(type="string", length=32)
  29. */
  30. protected $wordingUnit;
  31. /**
  32. * @ORM\Column(type="string", length=32)
  33. */
  34. protected $wordingShort;
  35. /**
  36. * @ORM\Column(type="integer")
  37. */
  38. protected $coefficient;
  39. /**
  40. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Config\UnitInterface")
  41. * @ORM\JoinColumn(nullable=true)
  42. */
  43. protected $unitReference;
  44. public function __toString()
  45. {
  46. return $this->getWording();
  47. }
  48. public function getUnit(): ?string
  49. {
  50. return $this->unit;
  51. }
  52. public function setUnit(string $unit): self
  53. {
  54. $this->unit = $unit;
  55. return $this;
  56. }
  57. public function getWording(): ?string
  58. {
  59. return $this->wording;
  60. }
  61. public function setWording(string $wording): self
  62. {
  63. $this->wording = $wording;
  64. return $this;
  65. }
  66. public function getWordingUnit(): ?string
  67. {
  68. return $this->wordingUnit;
  69. }
  70. public function setWordingUnit(string $wordingUnit): self
  71. {
  72. $this->wordingUnit = $wordingUnit;
  73. return $this;
  74. }
  75. public function getWordingShort(): ?string
  76. {
  77. return $this->wordingShort;
  78. }
  79. public function setWordingShort(string $wordingShort): self
  80. {
  81. $this->wordingShort = $wordingShort;
  82. return $this;
  83. }
  84. public function getCoefficient(): ?int
  85. {
  86. return $this->coefficient;
  87. }
  88. public function setCoefficient(int $coefficient): self
  89. {
  90. $this->coefficient = $coefficient;
  91. return $this;
  92. }
  93. public function getUnitReference(): ?self
  94. {
  95. return $this->unitReference;
  96. }
  97. public function setUnitReference(?UnitInterface $unitReference): self
  98. {
  99. $this->unitReference = $unitReference;
  100. return $this;
  101. }
  102. }