src/Entity/DiscountProducts.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DiscountProductsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=DiscountProductsRepository::class)
  7.  */
  8. class DiscountProducts
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=Discount::class, inversedBy="discountProducts")
  18.      * @ORM\JoinColumn(nullable=false)
  19.      */
  20.     private $discount;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="discountedProducts")
  23.      * @ORM\JoinColumn(nullable=false)
  24.      */
  25.     private $product;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getDiscount(): ?Discount
  31.     {
  32.         return $this->discount;
  33.     }
  34.     public function setDiscount(?Discount $discount): self
  35.     {
  36.         $this->discount $discount;
  37.         return $this;
  38.     }
  39.     public function getProduct(): ?Product
  40.     {
  41.         return $this->product;
  42.     }
  43.     public function setProduct(?Product $product): self
  44.     {
  45.         $this->product $product;
  46.         return $this;
  47.     }
  48. }