<?php
namespace App\Entity\Transporteurs;
use App\Entity\Utilisateur\Utilisateur;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use App\Annotations\SecuredEntity;
/**
* TranchePoids
*
* @ORM\Table("transporteur__tranche_poids")
* @ORM\Entity(repositoryClass="App\Repository\Transporteurs\TranchePoidsRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Tranche de Poids", group="TRANSPORTEURS")
*/
class TranchePoids
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="tranchePoids")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Transporteurs\Transporteur", inversedBy="tranchePoids")
* @ORM\JoinColumn(nullable=true)
*/
private $transporteur;
/**
* @ORM\Column(name="date", type="datetime")
*/
private $date;
/**
* @ORM\Column(name="debut", type="float", nullable=true)
* @Assert\NotBlank(message="Poids de départ obligatoire")
*/
private $debut;
/**
* @ORM\Column(name="fin", type="float", nullable=true)
* @Assert\NotBlank(message="Poids de fin obligatoire")
*/
private $fin;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
public function __construct()
{
$this->date = new Datetime();
}
public function getId(): int
{
return $this->id;
}
public function setDate(DateTime $date): TranchePoids
{
$this->date = $date;
return $this;
}
public function getDate(): DateTime
{
return $this->date;
}
public function setDebut(?float $debut): TranchePoids
{
$this->debut = $debut;
return $this;
}
public function getDebut(): ?float
{
return $this->debut;
}
public function setFin(?float $fin): TranchePoids
{
$this->fin = $fin;
return $this;
}
public function getFin(): ?float
{
return $this->fin;
}
public function setUtilisateur(?Utilisateur $utilisateur): TranchePoids
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function setTransporteur(?Transporteur $transporteur): TranchePoids
{
$this->transporteur = $transporteur;
return $this;
}
public function getTransporteur(): ?Transporteur
{
return $this->transporteur;
}
public function setDateSuppression(?DateTime $dateSuppression): TranchePoids
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): TranchePoids
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
}