<?php
namespace App\Entity;
use App\Repository\PrisEnChargeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PrisEnChargeRepository::class)
*/
class PrisEnCharge
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="float")
*/
private $prisencharge;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $remarque;
/**
* @ORM\ManyToOne(targetEntity=Assurance::class, inversedBy="prisEnCharges")
* @ORM\JoinColumn(nullable=false)
*/
private $assurance;
/**
* @ORM\OneToOne(targetEntity=FacturePatient::class, mappedBy="prisencharge", cascade={"persist", "remove"})
*/
private $facturePatient;
/**
* @ORM\ManyToOne(targetEntity=EtatPrisencharge::class, inversedBy="prisEnCharges")
* @ORM\JoinColumn(nullable=false)
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=HistoriqueReglement::class, mappedBy="prisencharge", orphanRemoval=true)
*/
private $historiqueReglements;
/**
* @ORM\Column(type="string", length=255)
*/
private $numero;
/**
* @ORM\Column(type="string", length=255)
*/
private $firstName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lastname;
/**
* @ORM\OneToOne(targetEntity=IctusCommande::class, mappedBy="prisencharge")
*/
private $ictusCommande;
public function __construct()
{
$this->historiqueReglements = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPrisencharge(): ?float
{
return $this->prisencharge;
}
public function setPrisencharge(float $prisencharge): self
{
$this->prisencharge = $prisencharge;
return $this;
}
public function getRemarque(): ?string
{
return $this->remarque;
}
public function setRemarque(?string $remarque): self
{
$this->remarque = $remarque;
return $this;
}
public function getAssurance(): ?Assurance
{
return $this->assurance;
}
public function setAssurance(?Assurance $assurance): self
{
$this->assurance = $assurance;
return $this;
}
public function getFacturePatient(): ?FacturePatient
{
return $this->facturePatient;
}
public function setFacturePatient(?FacturePatient $facturePatient): self
{
// unset the owning side of the relation if necessary
if ($facturePatient === null && $this->facturePatient !== null) {
$this->facturePatient->setPrisencharge(null);
}
// set the owning side of the relation if necessary
if ($facturePatient !== null && $facturePatient->getPrisencharge() !== $this) {
$facturePatient->setPrisencharge($this);
}
$this->facturePatient = $facturePatient;
return $this;
}
public function getEtat(): ?EtatPrisencharge
{
return $this->etat;
}
public function setEtat(?EtatPrisencharge $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, HistoriqueReglement>
*/
public function getHistoriqueReglements(): Collection
{
return $this->historiqueReglements;
}
public function addHistoriqueReglement(HistoriqueReglement $historiqueReglement): self
{
if (!$this->historiqueReglements->contains($historiqueReglement)) {
$this->historiqueReglements[] = $historiqueReglement;
$historiqueReglement->setPrisencharge($this);
}
return $this;
}
public function removeHistoriqueReglement(HistoriqueReglement $historiqueReglement): self
{
if ($this->historiqueReglements->removeElement($historiqueReglement)) {
// set the owning side to null (unless already changed)
if ($historiqueReglement->getPrisencharge() === $this) {
$historiqueReglement->setPrisencharge(null);
}
}
return $this;
}
public function getNumero(): ?string
{
return $this->numero;
}
public function setNumero(string $numero): self
{
$this->numero = $numero;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(?string $lastname): self
{
$this->lastname = $lastname;
return $this;
}
public function getIctusCommande(): ?IctusCommande
{
return $this->ictusCommande;
}
public function setIctusCommande(?IctusCommande $ictusCommande): self
{
// Éviter les boucles infinies
if ($this->ictusCommande === $ictusCommande) {
return $this;
}
$this->ictusCommande = $ictusCommande;
// Maintenir la cohérence bidirectionnelle
if ($ictusCommande !== null && $ictusCommande->getPrisencharge() !== $this) {
$ictusCommande->setPrisencharge($this);
}
return $this;
}
}