src/Entity/ProductService.php line 11

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