src/Entity/Transporteurs/TranchePoids.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Transporteurs;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use App\Annotations\SecuredEntity;
  9. /**
  10.  * TranchePoids
  11.  *
  12.  * @ORM\Table("transporteur__tranche_poids")
  13.  * @ORM\Entity(repositoryClass="App\Repository\Transporteurs\TranchePoidsRepository")
  14.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  15.  * @SecuredEntity(name="Tranche de Poids", group="TRANSPORTEURS")
  16.  */
  17. class TranchePoids
  18. {
  19.     /**
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="tranchePoids")
  28.      * @ORM\JoinColumn(nullable=true)
  29.      */
  30.     private $utilisateur;
  31.     
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity="App\Entity\Transporteurs\Transporteur", inversedBy="tranchePoids")
  34.      * @ORM\JoinColumn(nullable=true)
  35.      */
  36.     private $transporteur;
  37.     /**
  38.      * @ORM\Column(name="date", type="datetime")
  39.      */
  40.     private $date;
  41.     /**
  42.      * @ORM\Column(name="debut", type="float", nullable=true)
  43.      * @Assert\NotBlank(message="Poids de départ obligatoire")
  44.      */
  45.     private $debut;
  46.     /**
  47.      * @ORM\Column(name="fin", type="float", nullable=true)
  48.      * @Assert\NotBlank(message="Poids de fin obligatoire")
  49.      */
  50.     private $fin;
  51.     /**
  52.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  53.      */
  54.     private $dateSuppression;
  55.     /**
  56.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  57.      * @Gedmo\Timestampable(on="update")
  58.      */
  59.     private $dateMaj;
  60.     public function __construct()
  61.     {
  62.         $this->date = new Datetime();
  63.     }
  64.     public function getId(): int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function setDate(DateTime $date): TranchePoids
  69.     {
  70.         $this->date $date;
  71.         return $this;
  72.     }
  73.     public function getDate(): DateTime
  74.     {
  75.         return $this->date;
  76.     }
  77.     public function setDebut(?float $debut): TranchePoids
  78.     {
  79.         $this->debut $debut;
  80.         return $this;
  81.     }
  82.     public function getDebut(): ?float
  83.     {
  84.         return $this->debut;
  85.     }
  86.     public function setFin(?float $fin): TranchePoids
  87.     {
  88.         $this->fin $fin;
  89.         return $this;
  90.     }
  91.     public function getFin(): ?float
  92.     {
  93.         return $this->fin;
  94.     }
  95.     public function setUtilisateur(?Utilisateur $utilisateur): TranchePoids
  96.     {
  97.         $this->utilisateur $utilisateur;
  98.         return $this;
  99.     }
  100.     public function getUtilisateur(): ?Utilisateur
  101.     {
  102.         return $this->utilisateur;
  103.     }
  104.     public function setTransporteur(?Transporteur $transporteur): TranchePoids
  105.     {
  106.         $this->transporteur $transporteur;
  107.         return $this;
  108.     }
  109.     public function getTransporteur(): ?Transporteur
  110.     {
  111.         return $this->transporteur;
  112.     }
  113.     public function setDateSuppression(?DateTime $dateSuppression): TranchePoids
  114.     {
  115.         $this->dateSuppression $dateSuppression;
  116.         return $this;
  117.     }
  118.     public function getDateSuppression(): ?DateTime
  119.     {
  120.         return $this->dateSuppression;
  121.     }
  122.     public function setDateMaj(?DateTime $dateMaj): TranchePoids
  123.     {
  124.         $this->dateMaj $dateMaj;
  125.         return $this;
  126.     }
  127.     public function getDateMaj(): ?DateTime
  128.     {
  129.         return $this->dateMaj;
  130.     }
  131. }