src/Entity/Wishlist.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WishlistRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use App\Entity\ProductWishlist;
  7. /**
  8.  * @ORM\Entity(repositoryClass=WishlistRepository::class)
  9.  */
  10. class Wishlist
  11. {
  12.    /**
  13.      * @ORM\OneToMany(targetEntity="App\Entity\ProductWishlist", mappedBy="wishlist")
  14.      */
  15.     private $productWishlist;
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=User::class)
  24.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  25.      */
  26.     private $user;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $name;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $created_at;
  35.     /**
  36.      * @ORM\Column(type="datetime")
  37.      */
  38.     private $updated_at;
  39.     public function __construct()
  40.     {
  41.         $this->productWishlist = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getUser(): ?User
  48.     {
  49.         return $this->user;
  50.     }
  51.     public function setUser(?User $user): self
  52.     {
  53.         $this->user $user;
  54.         return $this;
  55.     }
  56.     public function getName(): ?string
  57.     {
  58.         return $this->name;
  59.     }
  60.     public function setName(string $name): self
  61.     {
  62.         $this->name $name;
  63.         return $this;
  64.     }
  65.     public function getCreatedAt(): ?\DateTimeInterface
  66.     {
  67.         return $this->created_at;
  68.     }
  69.     public function setCreatedAt(\DateTimeInterface $created_at): self
  70.     {
  71.         $this->created_at $created_at;
  72.         return $this;
  73.     }
  74.     public function getUpdatedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->updated_at;
  77.     }
  78.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  79.     {
  80.         $this->updated_at $updated_at;
  81.         return $this;
  82.     }
  83. }