src/Entity/PrisEnCharge.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PrisEnChargeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PrisEnChargeRepository::class)
  9.  */
  10. class PrisEnCharge
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="float")
  20.      */
  21.     private $prisencharge;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $remarque;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Assurance::class, inversedBy="prisEnCharges")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $assurance;
  31.     /**
  32.      * @ORM\OneToOne(targetEntity=FacturePatient::class, mappedBy="prisencharge", cascade={"persist", "remove"})
  33.      */
  34.     private $facturePatient;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=EtatPrisencharge::class, inversedBy="prisEnCharges")
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $etat;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=HistoriqueReglement::class, mappedBy="prisencharge", orphanRemoval=true)
  42.      */
  43.     private $historiqueReglements;
  44.     /**
  45.      * @ORM\Column(type="string", length=255)
  46.      */
  47.     private $numero;
  48.     /**
  49.      * @ORM\Column(type="string", length=255)
  50.      */
  51.     private $firstName;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $lastname;
  56.     /**
  57.      * @ORM\OneToOne(targetEntity=IctusCommande::class, mappedBy="prisencharge")
  58.      */
  59.     private $ictusCommande;
  60.     public function __construct()
  61.     {
  62.         $this->historiqueReglements = new ArrayCollection();
  63.     }
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getPrisencharge(): ?float
  69.     {
  70.         return $this->prisencharge;
  71.     }
  72.     public function setPrisencharge(float $prisencharge): self
  73.     {
  74.         $this->prisencharge $prisencharge;
  75.         return $this;
  76.     }
  77.     public function getRemarque(): ?string
  78.     {
  79.         return $this->remarque;
  80.     }
  81.     public function setRemarque(?string $remarque): self
  82.     {
  83.         $this->remarque $remarque;
  84.         return $this;
  85.     }
  86.     public function getAssurance(): ?Assurance
  87.     {
  88.         return $this->assurance;
  89.     }
  90.     public function setAssurance(?Assurance $assurance): self
  91.     {
  92.         $this->assurance $assurance;
  93.         return $this;
  94.     }
  95.     public function getFacturePatient(): ?FacturePatient
  96.     {
  97.         return $this->facturePatient;
  98.     }
  99.     public function setFacturePatient(?FacturePatient $facturePatient): self
  100.     {
  101.         // unset the owning side of the relation if necessary
  102.         if ($facturePatient === null && $this->facturePatient !== null) {
  103.             $this->facturePatient->setPrisencharge(null);
  104.         }
  105.         // set the owning side of the relation if necessary
  106.         if ($facturePatient !== null && $facturePatient->getPrisencharge() !== $this) {
  107.             $facturePatient->setPrisencharge($this);
  108.         }
  109.         $this->facturePatient $facturePatient;
  110.         return $this;
  111.     }
  112.     public function getEtat(): ?EtatPrisencharge
  113.     {
  114.         return $this->etat;
  115.     }
  116.     public function setEtat(?EtatPrisencharge $etat): self
  117.     {
  118.         $this->etat $etat;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, HistoriqueReglement>
  123.      */
  124.     public function getHistoriqueReglements(): Collection
  125.     {
  126.         return $this->historiqueReglements;
  127.     }
  128.     public function addHistoriqueReglement(HistoriqueReglement $historiqueReglement): self
  129.     {
  130.         if (!$this->historiqueReglements->contains($historiqueReglement)) {
  131.             $this->historiqueReglements[] = $historiqueReglement;
  132.             $historiqueReglement->setPrisencharge($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeHistoriqueReglement(HistoriqueReglement $historiqueReglement): self
  137.     {
  138.         if ($this->historiqueReglements->removeElement($historiqueReglement)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($historiqueReglement->getPrisencharge() === $this) {
  141.                 $historiqueReglement->setPrisencharge(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     public function getNumero(): ?string
  147.     {
  148.         return $this->numero;
  149.     }
  150.     public function setNumero(string $numero): self
  151.     {
  152.         $this->numero $numero;
  153.         return $this;
  154.     }
  155.     public function getFirstName(): ?string
  156.     {
  157.         return $this->firstName;
  158.     }
  159.     public function setFirstName(string $firstName): self
  160.     {
  161.         $this->firstName $firstName;
  162.         return $this;
  163.     }
  164.     public function getLastname(): ?string
  165.     {
  166.         return $this->lastname;
  167.     }
  168.     public function setLastname(?string $lastname): self
  169.     {
  170.         $this->lastname $lastname;
  171.         return $this;
  172.     }
  173.     public function getIctusCommande(): ?IctusCommande
  174.     {
  175.         return $this->ictusCommande;
  176.     }
  177.     public function setIctusCommande(?IctusCommande $ictusCommande): self
  178.     {
  179.         // Éviter les boucles infinies
  180.         if ($this->ictusCommande === $ictusCommande) {
  181.             return $this;
  182.         }
  183.         $this->ictusCommande $ictusCommande;
  184.         // Maintenir la cohérence bidirectionnelle
  185.         if ($ictusCommande !== null && $ictusCommande->getPrisencharge() !== $this) {
  186.             $ictusCommande->setPrisencharge($this);
  187.         }
  188.         return $this;
  189.     }
  190. }