<?php
namespace App\Entity;
use App\Entity\Traits\TimestampableTrait;
use App\Repository\TblMissionRepository;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TblMissionRepository::class)
* @Gedmo\Loggable
*/
class TblMission
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=TblPersonnel::class, inversedBy="missions")
* @ORM\JoinColumn(nullable=false)
* @Gedmo\Versioned
*/
private $personnel;
/**
* @ORM\ManyToOne(targetEntity=TblParcelle::class)
* @ORM\JoinColumn(nullable=false)
* @Gedmo\Versioned
*/
private $parcelle;
/**
* @ORM\ManyToOne(targetEntity=RefTypeOperationTravail::class)
* @ORM\JoinColumn(nullable=false)
* @Gedmo\Versioned
*/
private $typeOperationTravail;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Gedmo\Versioned
*/
private $description;
/**
* @ORM\Column(type="float")
* @Gedmo\Versioned
*/
private $montantMission;
/**
* @ORM\Column(type="date")
* @Gedmo\Versioned
*/
private $dateDebut;
/**
* @ORM\Column(type="date", nullable=true)
* @Gedmo\Versioned
*/
private $dateFin;
use TimestampableTrait;
public function getId(): ?int
{
return $this->id;
}
public function getPersonnel(): ?TblPersonnel
{
return $this->personnel;
}
public function setPersonnel(?TblPersonnel $personnel): self
{
$this->personnel = $personnel;
return $this;
}
public function getParcelle(): ?TblParcelle
{
return $this->parcelle;
}
public function setParcelle(?TblParcelle $parcelle): self
{
$this->parcelle = $parcelle;
return $this;
}
public function getTypeOperationTravail(): ?RefTypeOperationTravail
{
return $this->typeOperationTravail;
}
public function setTypeOperationTravail(?RefTypeOperationTravail $typeOperationTravail): self
{
$this->typeOperationTravail = $typeOperationTravail;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getMontantMission(): ?float
{
return $this->montantMission;
}
public function setMontantMission(float $montantMission): self
{
$this->montantMission = $montantMission;
return $this;
}
public function toArrayDatatable($urlEdit)
{
return [
$this->getDateDebut()->format('d/m/Y'),
$this->getPersonnel()->__toString(),
$this->getParcelle()->getParcelle(),
number_format($this->getMontantMission(), 2, ",", " "),
"<span class='badge badge-outline text-green'>".$this->getTypeOperationTravail()->__toString()."</span>",
$this->getDescription(),
'<a class="btn btn-primary" title="Modifier" href=' . $urlEdit . '><i class="ti ti-edit"></i></a>'
];
}
public function getDateDebut(): ?\DateTimeInterface
{
return $this->dateDebut;
}
public function setDateDebut(\DateTimeInterface $dateDebut): self
{
$this->dateDebut = $dateDebut;
return $this;
}
public function getDateFin(): ?\DateTimeInterface
{
return $this->dateFin;
}
public function setDateFin(?\DateTimeInterface $dateFin): self
{
$this->dateFin = $dateFin;
return $this;
}
}