src/Entity/AnalysisServicePriceModifier.php line 11

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace App\Entity;
  3. use App\Repository\AnalysisServicePriceModifierRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. #[ORM\Table]
  7. #[ORM\Entity(repositoryClass: AnalysisServicePriceModifierRepository::class)]
  8. class AnalysisServicePriceModifier
  9. {
  10. use TimestampableEntity;
  11. public const string SURCHARGE_ABSOLUT = 'absolute';
  12. public const string SURCHARGE_PERCENTAGE = 'percentage';
  13. public const string TYPE_STACK = 'stack';
  14. public const string TYPE_MODIFIER = 'modifier';
  15. #[ORM\Id]
  16. #[ORM\GeneratedValue]
  17. #[ORM\Column(type: 'integer')]
  18. private int $id;
  19. #[ORM\ManyToOne(targetEntity: AnalysisServicePrice::class, inversedBy: 'modifier')]
  20. private AnalysisServicePrice $price;
  21. #[ORM\Column(type: 'string')]
  22. private string $surchargeType = self::SURCHARGE_ABSOLUT;
  23. #[ORM\Column(type: 'string')]
  24. private string $type = self::TYPE_STACK;
  25. #[ORM\Column(type: 'integer', nullable: true)]
  26. private ?int $deliveryInDays = null;
  27. #[ORM\Column(type: 'integer', nullable: true)]
  28. private ?int $stack = null;
  29. #[ORM\Column(type: 'float', nullable: true)]
  30. private ?float $surcharge = null;
  31. public function getId(): int
  32. {
  33. return $this->id;
  34. }
  35. public function setId(int $id): AnalysisServicePriceModifier
  36. {
  37. $this->id = $id;
  38. return $this;
  39. }
  40. public function getPrice(): AnalysisServicePrice
  41. {
  42. return $this->price;
  43. }
  44. public function setPrice(AnalysisServicePrice $price): AnalysisServicePriceModifier
  45. {
  46. $this->price = $price;
  47. return $this;
  48. }
  49. public function getSurchargeType(): string
  50. {
  51. return $this->surchargeType;
  52. }
  53. public function setSurchargeType(string $surchargeType): AnalysisServicePriceModifier
  54. {
  55. $this->surchargeType = $surchargeType;
  56. return $this;
  57. }
  58. public function getType(): string
  59. {
  60. return $this->type;
  61. }
  62. public function setType(string $type): AnalysisServicePriceModifier
  63. {
  64. $this->type = $type;
  65. return $this;
  66. }
  67. public function getDeliveryInDays(): ?int
  68. {
  69. return $this->deliveryInDays;
  70. }
  71. public function setDeliveryInDays(?int $deliveryInDays): AnalysisServicePriceModifier
  72. {
  73. $this->deliveryInDays = $deliveryInDays;
  74. return $this;
  75. }
  76. public function getStack(): ?int
  77. {
  78. return $this->stack;
  79. }
  80. public function setStack(?int $stack): AnalysisServicePriceModifier
  81. {
  82. $this->stack = $stack;
  83. return $this;
  84. }
  85. public function getSurcharge(): ?float
  86. {
  87. return $this->surcharge;
  88. }
  89. public function setSurcharge(?float $surcharge): AnalysisServicePriceModifier
  90. {
  91. $this->surcharge = $surcharge;
  92. return $this;
  93. }
  94. }