src/Entity/TblOperationPaie.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TblOperationPaieRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\Traits\TimestampableTrait;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use App\Validator as PaieAssert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=TblOperationPaieRepository::class)
  10.  * @PaieAssert\Paie
  11.  * @Gedmo\Loggable
  12.  */
  13. class TblOperationPaie
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="date")
  23.      * @Gedmo\Versioned
  24.      */
  25.     private $date;
  26.     /**
  27.      * @ORM\Column(type="float")
  28.      * @Gedmo\Versioned
  29.      */
  30.     private $montant;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      * @Gedmo\Versioned
  34.      */
  35.     private $description;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=TblPersonnel::class , inversedBy="tblOperationPaie")
  38.      * @ORM\JoinColumn(nullable=false)
  39.      * @Gedmo\Versioned
  40.      */
  41.     private $personnel;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=RefTypeOperationPaie::class, inversedBy="operationPaies")
  44.      * @ORM\JoinColumn(name="type_operation_id", referencedColumnName="id", nullable=false)
  45.      * @Gedmo\Versioned
  46.      */
  47.     private $typeOperation;
  48.     use TimestampableTrait;
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getDate(): ?\DateTimeInterface
  54.     {
  55.         return $this->date;
  56.     }
  57.     public function setDate(?\DateTimeInterface $date): self
  58.     {
  59.         $this->date $date;
  60.         return $this;
  61.     }
  62.     public function getMontant(): ?float
  63.     {
  64.         return $this->montant;
  65.     }
  66.     public function setMontant(float $montant): self
  67.     {
  68.         $this->montant $montant;
  69.         return $this;
  70.     }
  71.     public function getDescription(): ?string
  72.     {
  73.         return $this->description;
  74.     }
  75.     public function setDescription(?string $description): self
  76.     {
  77.         $this->description $description;
  78.         return $this;
  79.     }
  80.     public function getPersonnel(): ?TblPersonnel
  81.     {
  82.         return $this->personnel;
  83.     }
  84.     public function setPersonnel(?TblPersonnel $personnel): self
  85.     {
  86.         $this->personnel $personnel;
  87.         return $this;
  88.     }
  89.     public function getTypeOperation(): ?RefTypeOperationPaie
  90.     {
  91.         return $this->typeOperation;
  92.     }
  93.     public function setTypeOperation(?RefTypeOperationPaie $typeOperation): self
  94.     {
  95.         $this->typeOperation $typeOperation;
  96.         return $this;
  97.     }
  98.     public function toArrayDatatable($urlEdit)
  99.     {
  100.         return [
  101.             $this->getPersonnel()->__toString(),
  102.             $this->getTypeOperation()->getId() == RefTypeOperationPaie::AVANCE ?  "<span class='badge badge-outline text-warning'>Avance</span>" "<span class='badge badge-outline text-green'>Paie</span>",
  103.             number_format($this->getMontant(), 2","" "),
  104.             $this->getCreatedBy()->__toString(),
  105.             $this->getDate()->format('d/m/Y'),
  106.             '<a class="btn btn-primary" title="Modifier" href=' $urlEdit '><i class="ti ti-edit"></i></a>',
  107.         ];
  108.     }
  109. }