src/Entity/ContractProduct.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\Product\ProductType;
  5. use App\Entity\Product;
  6. use App\Entity\RDV;
  7. use App\Repository\RDVProductRepository;
  8. use App\Entity\Contract;
  9. /**
  10.  * Product
  11.  *
  12.  * @ORM\Table(name="contract_product")
  13.  * @ORM\Entity(repositoryClass=RDVProductRepository::class)
  14.  */
  15. class ContractProduct
  16. {
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\Column(name="id", type="integer", nullable=false)
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="IDENTITY")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var Product
  27.      *
  28.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="rdvProduct")
  29.      * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  30.      */
  31.     private $product;
  32.     /**
  33.      * @var RDV
  34.      *
  35.      * @ORM\ManyToOne(targetEntity=Contract::class, inversedBy="rdvProduct")
  36.      * @ORM\JoinColumn(name="contract_id", referencedColumnName="id", onDelete="SET NULL")
  37.      */
  38.     private $contract;
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     /**
  44.      * @return Product
  45.      */
  46.     public function getProduct(): ?Product
  47.     {
  48.         return $this->product;
  49.     }
  50.     /**
  51.      * @param Product $product
  52.      */
  53.     public function setProduct(Product $product): void
  54.     {
  55.         $this->product $product;
  56.     }
  57.     /**
  58.      * @return RDV
  59.      */
  60.     public function getContract(): ?Contract
  61.     {
  62.         return $this->contract;
  63.     }
  64.     /**
  65.      * @param RDV $rdv
  66.      */
  67.     public function setContract(Contract $rdv): void
  68.     {
  69.         $this->contract $rdv;
  70.     }
  71. }