src/Entity/PTypeConge.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PTypeCongeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPTypeCongeRepository::class)]
  8. class PTypeConge
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255nullabletrue)]
  15.     private ?string $designation null;
  16.     #[ORM\Column(nullabletrue)]
  17.     private ?bool $active null;
  18.     #[ORM\OneToMany(mappedBy'typeConge'targetEntityDemandeConge::class)]
  19.     private Collection $demandeConges;
  20.     public function __construct()
  21.     {
  22.         $this->demandeConges = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getDesignation(): ?string
  29.     {
  30.         return $this->designation;
  31.     }
  32.     public function setDesignation(?string $designation): static
  33.     {
  34.         $this->designation $designation;
  35.         return $this;
  36.     }
  37.     public function isActive(): ?bool
  38.     {
  39.         return $this->active;
  40.     }
  41.     public function setActive(?bool $active): static
  42.     {
  43.         $this->active $active;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return Collection<int, DemandeConge>
  48.      */
  49.     public function getDemandeConges(): Collection
  50.     {
  51.         return $this->demandeConges;
  52.     }
  53.     public function addDemandeConge(DemandeConge $demandeConge): static
  54.     {
  55.         if (!$this->demandeConges->contains($demandeConge)) {
  56.             $this->demandeConges->add($demandeConge);
  57.             $demandeConge->setTypeConge($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeDemandeConge(DemandeConge $demandeConge): static
  62.     {
  63.         if ($this->demandeConges->removeElement($demandeConge)) {
  64.             // set the owning side to null (unless already changed)
  65.             if ($demandeConge->getTypeConge() === $this) {
  66.                 $demandeConge->setTypeConge(null);
  67.             }
  68.         }
  69.         return $this;
  70.     }
  71. }