src/Entity/RefTypeOperationPaie.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RefTypeOperationPaieRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Entity\Traits\TimestampableTrait;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. /**
  10.  * @ORM\Entity(repositoryClass=RefTypeOperationPaieRepository::class)
  11.  * @Gedmo\Loggable
  12.  */
  13. class RefTypeOperationPaie
  14. {
  15.     
  16.     const AVANCE 1;
  17.     const PAIE 2;
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      * @Gedmo\Versioned
  27.      */
  28.     private $lib;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      * @Gedmo\Versioned
  32.      */
  33.     private $libCourt;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=TblOperationPaie::class, mappedBy="typeOperation")
  36.      */
  37.     private $operationPaies;
  38.     public function __construct()
  39.     {
  40.         $this->operationPaies = new ArrayCollection();
  41.     }
  42.     public function __toString()
  43.     {
  44.         return $this->getLib();
  45.     }
  46.     
  47.     use TimestampableTrait;
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getLib(): ?string
  53.     {
  54.         return $this->lib;
  55.     }
  56.     public function setLib(string $lib): self
  57.     {
  58.         $this->lib $lib;
  59.         return $this;
  60.     }
  61.     public function getLibCourt(): ?string
  62.     {
  63.         return $this->libCourt;
  64.     }
  65.     public function setLibCourt(?string $libCourt): self
  66.     {
  67.         $this->libCourt $libCourt;
  68.         return $this;
  69.     }
  70.     /**
  71.      * @return Collection<int, TblOperationPaie>
  72.      */
  73.     public function getOperationPaies(): Collection
  74.     {
  75.         return $this->operationPaies;
  76.     }
  77.     public function addOperationPaie(TblOperationPaie $operationPaie): self
  78.     {
  79.         if (!$this->operationPaies->contains($operationPaie)) {
  80.             $this->operationPaies[] = $operationPaie;
  81.             $operationPaie->setTypeOperation($this);
  82.         }
  83.         return $this;
  84.     }
  85.     public function removeOperationPaie(TblOperationPaie $operationPaie): self
  86.     {
  87.         if ($this->operationPaies->removeElement($operationPaie)) {
  88.             // set the owning side to null (unless already changed)
  89.             if ($operationPaie->getTypeOperation() === $this) {
  90.                 $operationPaie->setTypeOperation(null);
  91.             }
  92.         }
  93.         return $this;
  94.     }
  95. }