<?php
namespace App\Entity;
use App\Repository\PayementRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PayementRepository::class)]
class Payement
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 15)]
private ?string $status = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\ManyToOne(inversedBy: 'payements')]
private ?Devis $devis = null;
#[ORM\OneToOne(mappedBy: 'payement', cascade: ['persist', 'remove'])]
private ?Facture $facture = null;
public function getId(): ?int
{
return $this->id;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): static
{
$this->status = $status;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getDevis(): ?Devis
{
return $this->devis;
}
public function setDevis(?Devis $devis): static
{
$this->devis = $devis;
return $this;
}
public function getFacture(): ?Facture
{
return $this->facture;
}
public function setFacture(Facture $facture): static
{
// set the owning side of the relation if necessary
if ($facture->getPayement() !== $this) {
$facture->setPayement($this);
}
$this->facture = $facture;
return $this;
}
}