<?php
namespace App\Entity;
use App\Repository\FavoriteRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FavoriteRepository::class)
*/
class Favorite
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="favorites")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="favorites")
*/
private $product;
/**
* @ORM\ManyToOne(targetEntity=Stockpharmacie::class, inversedBy="favorites")
*/
private $stockPharmacie;
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getStockPharmacie(): ?Stockpharmacie
{
return $this->stockPharmacie;
}
public function setStockPharmacie(?Stockpharmacie $stockPharmacie): self
{
$this->stockPharmacie = $stockPharmacie;
return $this;
}
}