<?php
namespace App\Entity\Order;
use App\Entity\Produit\Option;
use App\Repository\Order\OrderLineOptionRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OrderLineOptionRepository::class)]
class OrderLineOption
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'orderLineOptions')]
private ?Option $opt = 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\ManyToOne(inversedBy: 'orderLineOptions', 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 getOpt(): ?Option
{
return $this->opt;
}
public function setOpt(?Option $opt): static
{
$this->opt = $opt;
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->getOpt()->__toString();
}
}