<?php
namespace App\Entity;
use App\Repository\FavoriRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FavoriRepository::class)
*/
class Favori
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="favoris")
* @ORM\JoinColumn(nullable=false)
*/
private $User;
/**
* @ORM\ManyToOne(targetEntity=Livre::class, inversedBy="favoris")
* @ORM\JoinColumn(nullable=false)
*/
private $livre;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->User;
}
public function setUser(?User $User): self
{
$this->User = $User;
return $this;
}
public function getLivre(): ?Livre
{
return $this->livre;
}
public function setLivre(?Livre $livre): self
{
$this->livre = $livre;
return $this;
}
}