src/Entity/CartItemShipping.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CartItemShippingRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="item_shipping", columns={"item_id", "shipping_address_id"})})
  7. * @ORM\Entity(repositoryClass=CartItemShippingRepository::class)
  8. */
  9. class CartItemShipping
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="integer")
  19. */
  20. private $quantity;
  21. /**
  22. * @ORM\ManyToOne(targetEntity=CartItem::class, inversedBy="shipments")
  23. */
  24. private $item;
  25. /**
  26. * @ORM\ManyToOne(targetEntity=Address::class, inversedBy="cartItemShippings", cascade={"persist"})
  27. * @ORM\JoinColumn(unique=false)
  28. */
  29. private $shippingAddress;
  30. /**
  31. * @ORM\Column(type="boolean",options={"default": false})
  32. */
  33. private $init = FALSE;
  34. public function getId(): ?int
  35. {
  36. return $this->id;
  37. }
  38. public function getQuantity(): ?int
  39. {
  40. return $this->quantity;
  41. }
  42. public function setQuantity( int $quantity ): self
  43. {
  44. $this->quantity = $quantity;
  45. return $this;
  46. }
  47. public function getItem(): ?CartItem
  48. {
  49. return $this->item;
  50. }
  51. public function setItem( ?CartItem $item ): self
  52. {
  53. $this->item = $item;
  54. return $this;
  55. }
  56. public function getShippingAddress(): ?Address
  57. {
  58. return $this->shippingAddress;
  59. }
  60. public function setShippingAddress( ?Address $shippingAddress ): self
  61. {
  62. $this->shippingAddress = $shippingAddress;
  63. return $this;
  64. }
  65. public function getInit(): ?bool
  66. {
  67. return $this->init;
  68. }
  69. public function setInit( bool $init ): self
  70. {
  71. $this->init = $init;
  72. return $this;
  73. }
  74. }