src/Entity/TblMission.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\TimestampableTrait;
  4. use App\Repository\TblMissionRepository;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TblMissionRepository::class)
  9.  * @Gedmo\Loggable
  10.  */
  11. class TblMission
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=TblPersonnel::class, inversedBy="missions")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      * @Gedmo\Versioned
  23.      */
  24.     private $personnel;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=TblParcelle::class)
  27.      * @ORM\JoinColumn(nullable=false)
  28.      * @Gedmo\Versioned
  29.      */
  30.     private $parcelle;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=RefTypeOperationTravail::class)
  33.      * @ORM\JoinColumn(nullable=false)
  34.      * @Gedmo\Versioned
  35.      */
  36.     private $typeOperationTravail;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      * @Gedmo\Versioned
  40.      */
  41.     private $description;
  42.     /**
  43.      * @ORM\Column(type="float")
  44.      * @Gedmo\Versioned
  45.      */
  46.     private $montantMission;
  47.     /**
  48.      * @ORM\Column(type="date")
  49.      * @Gedmo\Versioned
  50.      */
  51.     private $dateDebut;
  52.     /**
  53.      * @ORM\Column(type="date", nullable=true)
  54.      * @Gedmo\Versioned
  55.      */
  56.     private $dateFin;
  57.     
  58.     use TimestampableTrait;
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getPersonnel(): ?TblPersonnel
  64.     {
  65.         return $this->personnel;
  66.     }
  67.     public function setPersonnel(?TblPersonnel $personnel): self
  68.     {
  69.         $this->personnel $personnel;
  70.         return $this;
  71.     }
  72.     public function getParcelle(): ?TblParcelle
  73.     {
  74.         return $this->parcelle;
  75.     }
  76.     public function setParcelle(?TblParcelle $parcelle): self
  77.     {
  78.         $this->parcelle $parcelle;
  79.         return $this;
  80.     }
  81.     public function getTypeOperationTravail(): ?RefTypeOperationTravail
  82.     {
  83.         return $this->typeOperationTravail;
  84.     }
  85.     public function setTypeOperationTravail(?RefTypeOperationTravail $typeOperationTravail): self
  86.     {
  87.         $this->typeOperationTravail $typeOperationTravail;
  88.         return $this;
  89.     }
  90.     public function getDescription(): ?string
  91.     {
  92.         return $this->description;
  93.     }
  94.     public function setDescription(?string $description): self
  95.     {
  96.         $this->description $description;
  97.         return $this;
  98.     }
  99.     public function getMontantMission(): ?float
  100.     {
  101.         return $this->montantMission;
  102.     }
  103.     public function setMontantMission(float $montantMission): self
  104.     {
  105.         $this->montantMission $montantMission;
  106.         return $this;
  107.     }
  108.     public function toArrayDatatable($urlEdit)
  109.     {
  110.         return [
  111.             $this->getDateDebut()->format('d/m/Y'),
  112.             $this->getPersonnel()->__toString(),
  113.             $this->getParcelle()->getParcelle(),
  114.             number_format($this->getMontantMission(), 2","" "),
  115.             "<span class='badge badge-outline text-green'>".$this->getTypeOperationTravail()->__toString()."</span>",
  116.             $this->getDescription(),
  117.             '<a class="btn btn-primary" title="Modifier" href=' $urlEdit '><i class="ti ti-edit"></i></a>'
  118.         ];
  119.     }
  120.     public function getDateDebut(): ?\DateTimeInterface
  121.     {
  122.         return $this->dateDebut;
  123.     }
  124.     public function setDateDebut(\DateTimeInterface $dateDebut): self
  125.     {
  126.         $this->dateDebut $dateDebut;
  127.         return $this;
  128.     }
  129.     public function getDateFin(): ?\DateTimeInterface
  130.     {
  131.         return $this->dateFin;
  132.     }
  133.     public function setDateFin(?\DateTimeInterface $dateFin): self
  134.     {
  135.         $this->dateFin $dateFin;
  136.         return $this;
  137.     }
  138. }