<?php
namespace App\Entity;
use App\Repository\TypePrestationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=TypePrestationRepository::class)
*/
class TypePrestation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $lib;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Prestation::class, mappedBy="typePrestation")
*/
private $prestations;
/**
* @ORM\Column(type="float", nullable=true)
* @Assert\Range(
* min = 0,
* max = 1,
* minMessage = "Le Taux doit au moins être égal à 0",
* maxMessage = "Le Taux doit au max être égal à 1"
* )
*/
private $taux;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $valeutMax;
/**
* @ORM\OneToMany(targetEntity=Dette::class, mappedBy="typePrestation")
*/
private $dettes;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $perodisite;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $palfont;
/**
* @ORM\OneToMany(targetEntity=PrimeTypePrestation::class, mappedBy="typePrestation",cascade={"persist"})
*/
private $primeTypePrestations;
public function __construct()
{
$this->prestations = new ArrayCollection();
$this->dettes = new ArrayCollection();
$this->primeTypePrestations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLib(): ?string
{
return $this->lib;
}
public function setLib(string $lib): self
{
$this->lib = $lib;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getEtat(): ?string
{
return $this->etat;
}
public function setEtat(string $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Prestation>
*/
public function getPrestations(): Collection
{
return $this->prestations;
}
public function addPrestation(Prestation $prestation): self
{
if (!$this->prestations->contains($prestation)) {
$this->prestations[] = $prestation;
$prestation->setTypePrestation($this);
}
return $this;
}
public function removePrestation(Prestation $prestation): self
{
if ($this->prestations->removeElement($prestation)) {
// set the owning side to null (unless already changed)
if ($prestation->getTypePrestation() === $this) {
$prestation->setTypePrestation(null);
}
}
return $this;
}
public function getTaux(): ?float
{
return $this->taux;
}
public function setTaux(?float $taux): self
{
$this->taux = $taux;
return $this;
}
public function getValeutMax(): ?float
{
return $this->valeutMax;
}
public function setValeutMax(?float $valeutMax): self
{
$this->valeutMax = $valeutMax;
return $this;
}
/**
* @return Collection<int, Dette>
*/
public function getDettes(): Collection
{
return $this->dettes;
}
public function addDette(Dette $dette): self
{
if (!$this->dettes->contains($dette)) {
$this->dettes[] = $dette;
$dette->setTypePrestation($this);
}
return $this;
}
public function removeDette(Dette $dette): self
{
if ($this->dettes->removeElement($dette)) {
// set the owning side to null (unless already changed)
if ($dette->getTypePrestation() === $this) {
$dette->setTypePrestation(null);
}
}
return $this;
}
public function getPerodisite(): ?int
{
return $this->perodisite;
}
public function setPerodisite(?int $perodisite): self
{
$this->perodisite = $perodisite;
return $this;
}
public function isPalfont(): ?bool
{
return $this->palfont;
}
public function setPalfont(?bool $palfont): self
{
$this->palfont = $palfont;
return $this;
}
/**
* @return Collection<int, PrimeTypePrestation>
*/
public function getPrimeTypePrestations(): Collection
{
return $this->primeTypePrestations;
}
public function addPrimeTypePrestation(PrimeTypePrestation $primeTypePrestation): self
{
if (!$this->primeTypePrestations->contains($primeTypePrestation)) {
$this->primeTypePrestations[] = $primeTypePrestation;
$primeTypePrestation->setTypePrestation($this);
}
return $this;
}
public function removePrimeTypePrestation(PrimeTypePrestation $primeTypePrestation): self
{
if ($this->primeTypePrestations->removeElement($primeTypePrestation)) {
// set the owning side to null (unless already changed)
if ($primeTypePrestation->getTypePrestation() === $this) {
$primeTypePrestation->setTypePrestation(null);
}
}
return $this;
}
}