<?php
namespace App\Entity;
use App\Repository\OrderProductSurfaceRepository;
use Doctrine\ORM\Mapping as ORM;
use JsonSerializable;
#[ORM\Entity(repositoryClass: OrderProductSurfaceRepository::class)]
class OrderProductSurface implements JsonSerializable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: OrderProduct::class, inversedBy: 'surfaces')]
#[ORM\JoinColumn(nullable: false)]
private $orderProduct;
#[ORM\Column(type: 'integer')]
private $qte;
#[ORM\ManyToOne(targetEntity: SurfaceReboisement::class, inversedBy: 'orderProductSurfaces')]
#[ORM\JoinColumn(nullable: false)]
private $surface;
public function getId(): ?int
{
return $this->id;
}
public function getOrderProduct(): ?OrderProduct
{
return $this->orderProduct;
}
public function setOrderProduct(?OrderProduct $orderProduct): self
{
$this->orderProduct = $orderProduct;
return $this;
}
public function getQte(): ?int
{
return $this->qte;
}
public function setQte(int $qte): self
{
$this->qte = $qte;
return $this;
}
public function getSurface(): ?SurfaceReboisement
{
return $this->surface;
}
public function setSurface(?SurfaceReboisement $surface): self
{
$this->surface = $surface;
return $this;
}
public function jsonSerialize()
{
$vars = get_object_vars($this);
unset($vars["orderProduct"]);
return $vars;
}
}