src/Entity/OrdenItem.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrdenItemRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=OrdenItemRepository::class)
  7. */
  8. class OrdenItem
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\ManyToOne(targetEntity=Orden::class, inversedBy="ordenItems",cascade={"persist"})
  18. */
  19. private $orden;
  20. /**
  21. * @ORM\ManyToOne(targetEntity=Product::class)
  22. */
  23. private $producto;
  24. public function __toString()
  25. {
  26. return $this->getProducto()->getProductName();
  27. }
  28. /**
  29. * @ORM\Column(type="integer")
  30. */
  31. private $qty;
  32. /**
  33. * @ORM\Column(type="float")
  34. */
  35. private $amt;
  36. /**
  37. * @ORM\ManyToOne(targetEntity=PromoCode::class)
  38. */
  39. private $promoCode;
  40. /**
  41. * @ORM\OneToOne(targetEntity=Subscription::class, inversedBy="ordenItem", cascade={"persist", "remove"})
  42. */
  43. private $subscription;
  44. public function getId(): ?int
  45. {
  46. return $this->id;
  47. }
  48. public function getOrden(): ?Orden
  49. {
  50. return $this->orden;
  51. }
  52. public function setOrden(?Orden $orden): self
  53. {
  54. $this->orden = $orden;
  55. return $this;
  56. }
  57. public function getProducto(): ?Product
  58. {
  59. return $this->producto;
  60. }
  61. public function setProducto(?Product $producto): self
  62. {
  63. $this->producto = $producto;
  64. return $this;
  65. }
  66. public function getQty(): ?int
  67. {
  68. return $this->qty;
  69. }
  70. public function setQty(int $qty): self
  71. {
  72. $this->qty = $qty;
  73. return $this;
  74. }
  75. public function getAmt(): ?float
  76. {
  77. return $this->amt;
  78. }
  79. public function setAmt(float $amt): self
  80. {
  81. $this->amt = $amt;
  82. return $this;
  83. }
  84. public function getPromoCode(): ?PromoCode
  85. {
  86. return $this->promoCode;
  87. }
  88. public function setPromoCode(?PromoCode $promoCode): self
  89. {
  90. $this->promoCode = $promoCode;
  91. return $this;
  92. }
  93. public function getSubscription(): ?Subscription
  94. {
  95. return $this->subscription;
  96. }
  97. public function setSubscription(?Subscription $subscription): self
  98. {
  99. $this->subscription = $subscription;
  100. return $this;
  101. }
  102. }