src/ECommerceBundle/Entity/CartHasCookie.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\ECommerceBundle\Entity;
  3. use Symfony\Component\Validator\Constraints as Assert;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Table("cart_has_cookie")
  7. * @ORM\Entity()
  8. */
  9. class CartHasCookie {
  10. /**
  11. * @ORM\Id
  12. * @ORM\OneToOne(targetEntity="Cart", inversedBy="cartHasCookie", cascade={"persist"})
  13. * @ORM\JoinColumn(name="cart_id", referencedColumnName="id", onDelete="CASCADE")
  14. */
  15. private ?Cart $cart=null;
  16. /**
  17. * @ORM\Column(name="cookie", type="string", length=255)
  18. */
  19. private ?string $cookie=null;
  20. public function getCookie(): ?string
  21. {
  22. return $this->cookie;
  23. }
  24. public function setCookie(string $cookie): self
  25. {
  26. $this->cookie = $cookie;
  27. return $this;
  28. }
  29. public function getCart(): ?Cart
  30. {
  31. return $this->cart;
  32. }
  33. public function setCart(?Cart $cart): self
  34. {
  35. $this->cart = $cart;
  36. return $this;
  37. }
  38. }