<?php
namespace App\Entity\Order;
use App\Entity\Produit\Finition;
use App\Repository\Order\OrderLineFinitionRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OrderLineFinitionRepository::class)]
class OrderLineFinition
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'orderLineFinitions')]
private ?Finition $finition = null;
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)]
private ?string $priceTtc = null;
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)]
private ?string $priceHt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\OneToOne(targetEntity: OrderLine::class, inversedBy: 'orderLineFinition', cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(name: 'orderline_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
private ?OrderLine $orderLine = null;
public function getId(): ?int
{
return $this->id;
}
public function getFinition(): ?Finition
{
return $this->finition;
}
public function setFinition(?Finition $finition): static
{
$this->finition = $finition;
return $this;
}
public function getPriceTtc(): ?string
{
return $this->priceTtc;
}
public function setPriceTtc(?string $priceTtc): static
{
$this->priceTtc = $priceTtc;
return $this;
}
public function getPriceHt(): ?string
{
return $this->priceHt;
}
public function setPriceHt(?string $priceHt): static
{
$this->priceHt = $priceHt;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getOrderLine(): ?OrderLine
{
return $this->orderLine;
}
public function setOrderLine(?OrderLine $orderLine): static
{
$this->orderLine = $orderLine;
return $this;
}
public function __toString(){
return $this->getFinition()->getName()." (".$this->priceTtc.")";
}
}