<?php
namespace App\Entity;
use App\Repository\DiscountProductsRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=DiscountProductsRepository::class)
*/
class DiscountProducts
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Discount::class, inversedBy="discountProducts")
* @ORM\JoinColumn(nullable=false)
*/
private $discount;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="discountedProducts")
* @ORM\JoinColumn(nullable=false)
*/
private $product;
public function getId(): ?int
{
return $this->id;
}
public function getDiscount(): ?Discount
{
return $this->discount;
}
public function setDiscount(?Discount $discount): self
{
$this->discount = $discount;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
}