<?php
namespace App\Entity;
use App\Repository\TypeFactureRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TypeFactureRepository::class)
*/
class TypeFacture
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $designation;
/**
* @ORM\Column(type="float")
*/
private $value;
/**
* @ORM\OneToMany(targetEntity=FacturePatient::class, mappedBy="typefacture", orphanRemoval=true)
*/
private $facturePatients;
/**
* @ORM\OneToMany(targetEntity=FacturePharmacie::class, mappedBy="typeFacture")
*/
private $facturePharmacies;
public function __construct()
{
$this->facturePatients = new ArrayCollection();
$this->facturePharmacies = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(string $designation): self
{
$this->designation = $designation;
return $this;
}
public function getValue(): ?float
{
return $this->value;
}
public function setValue(float $value): self
{
$this->value = $value;
return $this;
}
/**
* @return Collection<int, FacturePatient>
*/
public function getFacturePatients(): Collection
{
return $this->facturePatients;
}
public function addFacturePatient(FacturePatient $facturePatient): self
{
if (!$this->facturePatients->contains($facturePatient)) {
$this->facturePatients[] = $facturePatient;
$facturePatient->setTypefacture($this);
}
return $this;
}
public function removeFacturePatient(FacturePatient $facturePatient): self
{
if ($this->facturePatients->removeElement($facturePatient)) {
// set the owning side to null (unless already changed)
if ($facturePatient->getTypefacture() === $this) {
$facturePatient->setTypefacture(null);
}
}
return $this;
}
/**
* @return Collection<int, FacturePharmacie>
*/
public function getFacturePharmacies(): Collection
{
return $this->facturePharmacies;
}
public function addFacturePharmacy(FacturePharmacie $facturePharmacy): self
{
if (!$this->facturePharmacies->contains($facturePharmacy)) {
$this->facturePharmacies[] = $facturePharmacy;
$facturePharmacy->setTypeFacture($this);
}
return $this;
}
public function removeFacturePharmacy(FacturePharmacie $facturePharmacy): self
{
if ($this->facturePharmacies->removeElement($facturePharmacy)) {
// set the owning side to null (unless already changed)
if ($facturePharmacy->getTypeFacture() === $this) {
$facturePharmacy->setTypeFacture(null);
}
}
return $this;
}
}