src/Entity/ShippingRate.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Carrier
  6. *
  7. * @ORM\Table(name="shipping_rates")
  8. * @ORM\Entity(repositoryClass="App\Repository\ShippingRateRepository")
  9. */
  10. class ShippingRate
  11. {
  12. public const VAT_RATE = 0.2;
  13. /**
  14. * @var int
  15. *
  16. * @ORM\Column(name="id", type="integer", nullable=false)
  17. * @ORM\Id
  18. * @ORM\GeneratedValue(strategy="IDENTITY")
  19. */
  20. private $id;
  21. /**
  22. * @var \App\Entity\Carrier
  23. *
  24. * @ORM\ManyToOne(targetEntity="App\Entity\Carrier")
  25. * @ORM\JoinColumn(name="carrier_id", referencedColumnName="id")
  26. */
  27. private $carrier;
  28. /**
  29. * @var \App\Entity\Country
  30. *
  31. * @ORM\ManyToOne(targetEntity="App\Entity\Country")
  32. * @ORM\JoinColumn(name="countries_id", referencedColumnName="countries_id")
  33. */
  34. private $country;
  35. /**
  36. * @var ?float
  37. *
  38. * @ORM\Column(name="from_cart_amount", type="float", nullable=true)
  39. */
  40. private $fromCartAmount;
  41. /**
  42. * @var float
  43. *
  44. * @ORM\Column(name="price", type="float", nullable=false, options={"default":"0"})
  45. */
  46. private $price;
  47. public function getId(): int {
  48. return $this->id;
  49. }
  50. public function getCarrier(): \App\Entity\Carrier {
  51. return $this->carrier;
  52. }
  53. public function getCountry(): \App\Entity\Country {
  54. return $this->country;
  55. }
  56. public function getFromCartAmount(): ?float {
  57. return $this->fromCartAmount;
  58. }
  59. public function getPrice(): float {
  60. return $this->price;
  61. }
  62. public function setId(int $id): void {
  63. $this->id = $id;
  64. }
  65. public function setCarrier(\App\Entity\Carrier $carrier): void {
  66. $this->carrier = $carrier;
  67. }
  68. public function setCountry(\App\Entity\Country $country): void {
  69. $this->country = $country;
  70. }
  71. public function setFromCartAmount(?float $fromCartAmount): void {
  72. $this->fromCartAmount = $fromCartAmount;
  73. }
  74. public function setPrice(float $price): void {
  75. $this->price = $price;
  76. }
  77. }