src/Entity/System/Wishlist.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * Wishlist
  7. *
  8. * @ORM\Table(name="wishlist")
  9. *
  10. * @ORM\Entity(repositoryClass="App\Repository\System\WishlistRepository")
  11. */
  12. class Wishlist
  13. {
  14. public const FAVORITE_TYPE_ID = 1;
  15. public const CUSTOM_TYPE_ID = 2;
  16. public const DEFAULT_TYPE_NAME_ES = 'Favoritos';
  17. public const DEFAULT_TYPE_NAME_EN = 'Favorites';
  18. public const MAX_NUM_WISHLIST = 10;
  19. public const MAX_NUM_PRODUCTS_BY_WISHLIST = 200;
  20. /**
  21. * @ORM\Id()
  22. *
  23. * @ORM\GeneratedValue()
  24. *
  25. * @ORM\Column(type="integer", name="id")
  26. */
  27. protected $id;
  28. /**
  29. * @var Customer
  30. *
  31. * @ORM\ManyToOne(targetEntity="App\Entity\System\Customer", inversedBy="wishlists")
  32. *
  33. * @ORM\JoinColumn(name="customer_id", referencedColumnName="id_customer", nullable=false)
  34. */
  35. protected $customer;
  36. /**
  37. * @var string|null
  38. *
  39. * @ORM\Column(type="string", length=100, nullable=false)
  40. */
  41. protected $name;
  42. /**
  43. * @var int
  44. *
  45. * @ORM\Column(type="integer")
  46. */
  47. protected $type;
  48. /**
  49. * @var ProductTracking[]|ArrayCollection
  50. *
  51. * @ORM\OneToMany(targetEntity="ProductTracking", mappedBy="wishlist")
  52. */
  53. protected $products;
  54. /**
  55. * @return mixed
  56. */
  57. public function getId()
  58. {
  59. return $this->id;
  60. }
  61. public function getCustomer(): Customer
  62. {
  63. return $this->customer;
  64. }
  65. public function getName(): ?string
  66. {
  67. return $this->name;
  68. }
  69. /**
  70. * @return int
  71. */
  72. public function getType(): int
  73. {
  74. return $this->type;
  75. }
  76. /**
  77. * @return ProductTracking[]|ArrayCollection
  78. */
  79. public function getProducts()
  80. {
  81. return $this->products;
  82. }
  83. public function setId($id)
  84. {
  85. $this->id = $id;
  86. return $this;
  87. }
  88. public function setCustomer(Customer $customer): Wishlist
  89. {
  90. $this->customer = $customer;
  91. return $this;
  92. }
  93. public function setName(?string $name): Wishlist
  94. {
  95. $this->name = $name;
  96. return $this;
  97. }
  98. public function setType(int $type): Wishlist
  99. {
  100. $this->type = $type;
  101. return $this;
  102. }
  103. public function setProducts($products)
  104. {
  105. $this->products = $products;
  106. return $this;
  107. }
  108. }