src/Entity/TypePrestation.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TypePrestationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=TypePrestationRepository::class)
  10.  */
  11. class TypePrestation
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $lib;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $description;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $etat;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=Prestation::class, mappedBy="typePrestation")
  33.      */
  34.     private $prestations;
  35.     /**
  36.      * @ORM\Column(type="float", nullable=true)
  37.      * @Assert\Range(
  38.      *      min = 0,
  39.      *      max = 1,
  40.      *      minMessage = "Le Taux doit au moins être égal à 0",
  41.      *      maxMessage = "Le Taux doit au max être égal à 1"
  42.      *      )
  43.      */
  44.     private $taux;
  45.     /**
  46.      * @ORM\Column(type="float", nullable=true)
  47.      */
  48.     private $valeutMax;
  49.     /**
  50.      * @ORM\OneToMany(targetEntity=Dette::class, mappedBy="typePrestation")
  51.      */
  52.     private $dettes;
  53.     /**
  54.      * @ORM\Column(type="integer", nullable=true)
  55.      */
  56.     private $perodisite;
  57.     /**
  58.      * @ORM\Column(type="boolean", nullable=true)
  59.      */
  60.     private $palfont;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity=PrimeTypePrestation::class, mappedBy="typePrestation",cascade={"persist"})
  63.      */
  64.     private $primeTypePrestations;
  65.     public function __construct()
  66.     {
  67.         $this->prestations = new ArrayCollection();
  68.         $this->dettes = new ArrayCollection();
  69.         $this->primeTypePrestations = new ArrayCollection();
  70.     }
  71.     public function getId(): ?int
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function getLib(): ?string
  76.     {
  77.         return $this->lib;
  78.     }
  79.     public function setLib(string $lib): self
  80.     {
  81.         $this->lib = $lib;
  82.         return $this;
  83.     }
  84.     public function getDescription(): ?string
  85.     {
  86.         return $this->description;
  87.     }
  88.     public function setDescription(?string $description): self
  89.     {
  90.         $this->description = $description;
  91.         return $this;
  92.     }
  93.     public function getEtat(): ?string
  94.     {
  95.         return $this->etat;
  96.     }
  97.     public function setEtat(string $etat): self
  98.     {
  99.         $this->etat = $etat;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection<int, Prestation>
  104.      */
  105.     public function getPrestations(): Collection
  106.     {
  107.         return $this->prestations;
  108.     }
  109.     public function addPrestation(Prestation $prestation): self
  110.     {
  111.         if (!$this->prestations->contains($prestation)) {
  112.             $this->prestations[] = $prestation;
  113.             $prestation->setTypePrestation($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removePrestation(Prestation $prestation): self
  118.     {
  119.         if ($this->prestations->removeElement($prestation)) {
  120.             // set the owning side to null (unless already changed)
  121.             if ($prestation->getTypePrestation() === $this) {
  122.                 $prestation->setTypePrestation(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127.     public function getTaux(): ?float
  128.     {
  129.         return $this->taux;
  130.     }
  131.     public function setTaux(?float $taux): self
  132.     {
  133.         $this->taux = $taux;
  134.         return $this;
  135.     }
  136.     public function getValeutMax(): ?float
  137.     {
  138.         return $this->valeutMax;
  139.     }
  140.     public function setValeutMax(?float $valeutMax): self
  141.     {
  142.         $this->valeutMax = $valeutMax;
  143.         return $this;
  144.     }
  145.     /**
  146.      * @return Collection<int, Dette>
  147.      */
  148.     public function getDettes(): Collection
  149.     {
  150.         return $this->dettes;
  151.     }
  152.     public function addDette(Dette $dette): self
  153.     {
  154.         if (!$this->dettes->contains($dette)) {
  155.             $this->dettes[] = $dette;
  156.             $dette->setTypePrestation($this);
  157.         }
  158.         return $this;
  159.     }
  160.     public function removeDette(Dette $dette): self
  161.     {
  162.         if ($this->dettes->removeElement($dette)) {
  163.             // set the owning side to null (unless already changed)
  164.             if ($dette->getTypePrestation() === $this) {
  165.                 $dette->setTypePrestation(null);
  166.             }
  167.         }
  168.         return $this;
  169.     }
  170.     public function getPerodisite(): ?int
  171.     {
  172.         return $this->perodisite;
  173.     }
  174.     public function setPerodisite(?int $perodisite): self
  175.     {
  176.         $this->perodisite = $perodisite;
  177.         return $this;
  178.     }
  179.     public function isPalfont(): ?bool
  180.     {
  181.         return $this->palfont;
  182.     }
  183.     public function setPalfont(?bool $palfont): self
  184.     {
  185.         $this->palfont = $palfont;
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return Collection<int, PrimeTypePrestation>
  190.      */
  191.     public function getPrimeTypePrestations(): Collection
  192.     {
  193.         return $this->primeTypePrestations;
  194.     }
  195.     public function addPrimeTypePrestation(PrimeTypePrestation $primeTypePrestation): self
  196.     {
  197.         if (!$this->primeTypePrestations->contains($primeTypePrestation)) {
  198.             $this->primeTypePrestations[] = $primeTypePrestation;
  199.             $primeTypePrestation->setTypePrestation($this);
  200.         }
  201.         return $this;
  202.     }
  203.     public function removePrimeTypePrestation(PrimeTypePrestation $primeTypePrestation): self
  204.     {
  205.         if ($this->primeTypePrestations->removeElement($primeTypePrestation)) {
  206.             // set the owning side to null (unless already changed)
  207.             if ($primeTypePrestation->getTypePrestation() === $this) {
  208.                 $primeTypePrestation->setTypePrestation(null);
  209.             }
  210.         }
  211.         return $this;
  212.     }
  213. }