<?php
namespace App\Entity;
use App\Entity\Order\Order;
use App\Entity\Carrier\Carrier;
use App\Entity\Produit\Produit;
use App\Repository\ProduitCarrierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProduitCarrierRepository::class)]
class ProduitCarrier
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable:true)]
private $priceHt;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable:true)]
private $priceTtc;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable:true)]
private $taxRate;
#[ORM\ManyToOne(inversedBy: 'produitCarriers')]
private ?Produit $produit = null;
#[ORM\ManyToOne(inversedBy: 'produitCarriers')]
private ?Carrier $carrier = null;
public function __toString(){
return $this->getCarrier()->getName();
}
public function getId(): ?int
{
return $this->id;
}
public function getProduit(): ?Produit
{
return $this->produit;
}
public function setProduit(?Produit $produit): static
{
$this->produit = $produit;
return $this;
}
public function getCarrier(): ?Carrier
{
return $this->carrier;
}
public function setCarrier(?Carrier $carrier): static
{
$this->carrier = $carrier;
return $this;
}
public function getPrice(): ?string
{
return $this->priceTtc;
}
public function getPriceHt()
{
return $this->priceHt;
}
public function setPriceHt($priceHt): self
{
$this->priceHt = $priceHt;
return $this;
}
public function getPriceTtc()
{
return $this->priceTtc;
}
public function setPriceTtc($priceTtc): self
{
$this->priceTtc = $priceTtc;
return $this;
}
public function getTaxRate()
{
return $this->taxRate;
}
public function setTaxRate($taxRate): self
{
$this->taxRate = $taxRate;
return $this;
}
}