<?phpnamespace App\Entity;use App\Repository\SurfaceReboisementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use JsonSerializable;#[ORM\Entity(repositoryClass: SurfaceReboisementRepository::class)]class SurfaceReboisement implements JsonSerializable{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255)] private $nom; #[ORM\Column(type: 'float')] private $longitude; #[ORM\Column(type: 'float')] private $latitude; #[ORM\Column(type: 'decimal', precision: 12, scale: 2)] private $rayon; #[ORM\Column(type: 'integer')] private $nbrArbres; #[ORM\Column(type: 'integer')] private $statut; #[ORM\Column(type: 'datetime')] private $dateCreation; #[ORM\OneToMany(targetEntity: OrderProductSurface::class, mappedBy: 'surface')] private $orderProductSurfaces; #[ORM\OneToOne(targetEntity: ViewSurfaceQteArbres::class, mappedBy: 'surfaceReboisement', cascade: ['persist', 'remove'])] private $surfaceQteArbres; public function __construct() { $this->orderProductSurfaces = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNom(): ?string { return $this->nom; } public function setNom(string $nom): self { $this->nom = $nom; return $this; } public function getLongitude(): ?float { return $this->longitude; } public function setLongitude(float $longitude): self { $this->longitude = $longitude; return $this; } public function getLatitude(): ?float { return $this->latitude; } public function setLatitude(float $latitude): self { $this->latitude = $latitude; return $this; } public function getRayon(): ?string { return $this->rayon; } public function setRayon(string $rayon): self { $this->rayon = $rayon; return $this; } public function getNbrArbres(): ?int { return $this->nbrArbres; } public function setNbrArbres(int $nbrArbres): self { $this->nbrArbres = $nbrArbres; return $this; } public function getStatut(): ?int { return $this->statut; } public function setStatut(int $statut): self { $this->statut = $statut; return $this; } public function getDateCreation(): ?\DateTimeInterface { return $this->dateCreation; } public function setDateCreation(\DateTimeInterface $dateCreation): self { $this->dateCreation = $dateCreation; return $this; } /** * @return Collection<int, OrderProductSurface> */ public function getOrderProductSurfaces(): Collection { return $this->orderProductSurfaces; } public function addOrderProductSurface(OrderProductSurface $orderProductSurface): self { if (!$this->orderProductSurfaces->contains($orderProductSurface)) { $this->orderProductSurfaces[] = $orderProductSurface; $orderProductSurface->setSurface($this); } return $this; } public function removeOrderProductSurface(OrderProductSurface $orderProductSurface): self { if ($this->orderProductSurfaces->removeElement($orderProductSurface)) { // set the owning side to null (unless already changed) if ($orderProductSurface->getSurface() === $this) { $orderProductSurface->setSurface(null); } } return $this; } public function getSurfaceQteArbres(): ?ViewSurfaceQteArbres { return $this->surfaceQteArbres; } public function setSurfaceQteArbres(ViewSurfaceQteArbres $surfaceQteArbres): self { // set the owning side of the relation if necessary if ($surfaceQteArbres->getSurfaceReboisement() !== $this) { $surfaceQteArbres->setSurfaceReboisement($this); } $this->surfaceQteArbres = $surfaceQteArbres; return $this; } public function jsonSerialize() { $vars = get_object_vars($this); unset($vars["orderProductSurfaces"]); unset($vars["surfaceQteArbres"]); return $vars; }}