<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Product\ProductType;
use App\Entity\Product;
use App\Entity\RDV;
use App\Repository\RDVProductRepository;
use App\Entity\Contract;
/**
* Product
*
* @ORM\Table(name="contract_product")
* @ORM\Entity(repositoryClass=RDVProductRepository::class)
*/
class ContractProduct
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var Product
*
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="rdvProduct")
* @ORM\JoinColumn(name="product_id", referencedColumnName="id")
*/
private $product;
/**
* @var RDV
*
* @ORM\ManyToOne(targetEntity=Contract::class, inversedBy="rdvProduct")
* @ORM\JoinColumn(name="contract_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $contract;
public function getId(): ?int
{
return $this->id;
}
/**
* @return Product
*/
public function getProduct(): ?Product
{
return $this->product;
}
/**
* @param Product $product
*/
public function setProduct(Product $product): void
{
$this->product = $product;
}
/**
* @return RDV
*/
public function getContract(): ?Contract
{
return $this->contract;
}
/**
* @param RDV $rdv
*/
public function setContract(Contract $rdv): void
{
$this->contract = $rdv;
}
}