<?php namespace App\Entity; use App\Repository\CartItemShippingRepository; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="item_shipping", columns={"item_id", "shipping_address_id"})}) * @ORM\Entity(repositoryClass=CartItemShippingRepository::class) */ class CartItemShipping { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="integer") */ private $quantity; /** * @ORM\ManyToOne(targetEntity=CartItem::class, inversedBy="shipments") */ private $item; /** * @ORM\ManyToOne(targetEntity=Address::class, inversedBy="cartItemShippings", cascade={"persist"}) * @ORM\JoinColumn(unique=false) */ private $shippingAddress; /** * @ORM\Column(type="boolean",options={"default": false}) */ private $init = FALSE; public function getId(): ?int { return $this->id; } public function getQuantity(): ?int { return $this->quantity; } public function setQuantity( int $quantity ): self { $this->quantity = $quantity; return $this; } public function getItem(): ?CartItem { return $this->item; } public function setItem( ?CartItem $item ): self { $this->item = $item; return $this; } public function getShippingAddress(): ?Address { return $this->shippingAddress; } public function setShippingAddress( ?Address $shippingAddress ): self { $this->shippingAddress = $shippingAddress; return $this; } public function getInit(): ?bool { return $this->init; } public function setInit( bool $init ): self { $this->init = $init; return $this; } }