src/Entity/CartItem.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CartItemRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=CartItemRepository::class)
  7. * @ORM\EntityListeners({
  8. * "App\Listener\EntityListener"
  9. * })
  10. */
  11. class CartItem
  12. {
  13. /**
  14. * @ORM\Id()
  15. * @ORM\GeneratedValue()
  16. * @ORM\Column(type="integer")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\ManyToOne(targetEntity=Cart::class, inversedBy="cartItems", cascade={"persist"})
  21. * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  22. */
  23. private $cart;
  24. /**
  25. * @ORM\ManyToOne(targetEntity=Product::class)
  26. * @ORM\JoinColumn(nullable=false)
  27. */
  28. private $product;
  29. /**
  30. * @ORM\ManyToOne(targetEntity=Variant::class)
  31. * @ORM\JoinColumn(nullable=false)
  32. */
  33. private $variant;
  34. /**
  35. * @ORM\Column(type="datetime")
  36. */
  37. private $createts;
  38. /**
  39. * @ORM\Column(type="integer")
  40. */
  41. private $count;
  42. public function getId(): ?int
  43. {
  44. return $this->id;
  45. }
  46. public function getCart(): ?Cart
  47. {
  48. return $this->cart;
  49. }
  50. public function setCart(?Cart $cart): self
  51. {
  52. $this->cart = $cart;
  53. return $this;
  54. }
  55. public function getProduct(): ?Product
  56. {
  57. return $this->product;
  58. }
  59. public function setProduct(?Product $product): self
  60. {
  61. $this->product = $product;
  62. return $this;
  63. }
  64. public function getVariant(): ?Variant
  65. {
  66. return $this->variant;
  67. }
  68. public function setVariant(?Variant $variant): self
  69. {
  70. $this->variant = $variant;
  71. return $this;
  72. }
  73. public function getCreatets(): ?\DateTimeInterface
  74. {
  75. return $this->createts;
  76. }
  77. public function setCreatets(\DateTimeInterface $createts): self
  78. {
  79. $this->createts = $createts;
  80. return $this;
  81. }
  82. public function getCount(): ?int
  83. {
  84. return $this->count;
  85. }
  86. public function setCount(int $count): self
  87. {
  88. $this->count = $count;
  89. return $this;
  90. }
  91. }