<?php
namespace App\Entity\Transporteurs;
use App\Entity\Localisation\Zone;
use App\Entity\Utilisateur\Utilisateur;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use App\Annotations\SecuredEntity;
/**
* ZoneLivraison
*
* @ORM\Table("transporteur__zone_livraison")
* @ORM\Entity(repositoryClass="App\Repository\Transporteurs\ZoneLivraisonRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Zone de Livraison", group="TRANSPORTEURS")
*/
class ZoneLivraison
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(name="reference", type="string", length=255, nullable=true)
*/
private $reference;
/**
* @ORM\Column(name="id_import", type="string",length=255, nullable=true)
*/
private $idImport;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Localisation\Zone", mappedBy="zoneLivraison")
*/
private $zoneLocalisation;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Transporteurs\TransporteurZoneLivraison", mappedBy="zoneLivraison")
*/
private $transporteurZoneLivraison;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="zoneLivraison")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="libelle", type="string", length=255,nullable=true)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @ORM\Column(name="date", type="datetime")
*/
private $date;
/**
* @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();
$this->transporteurZoneLivraison = new ArrayCollection();
$this->zoneLocalisation = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): ZoneLivraison
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(DateTime $date): ZoneLivraison
{
$this->date = $date;
return $this;
}
public function getDate(): DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): ZoneLivraison
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): ZoneLivraison
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setUtilisateur(?Utilisateur $utilisateur): ZoneLivraison
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addZoneLocalisation(Zone $zoneLocalisation): ZoneLivraison
{
$this->zoneLocalisation[] = $zoneLocalisation;
return $this;
}
public function removeZoneLocalisation(Zone $zoneLocalisation)
{
$this->zoneLocalisation->removeElement($zoneLocalisation);
}
public function getZoneLocalisation(): Collection
{
return $this->zoneLocalisation;
}
public function addTransporteurZoneLivraison(ZoneLivraison $transporteurZoneLivraison): ZoneLivraison
{
$this->transporteurZoneLivraison[] = $transporteurZoneLivraison;
return $this;
}
public function removeTransporteurZoneLivraison(ZoneLivraison $transporteurZoneLivraison)
{
$this->transporteurZoneLivraison->removeElement($transporteurZoneLivraison);
}
public function getTransporteurZoneLivraison(): Collection
{
return $this->transporteurZoneLivraison;
}
public function __toString() {
return $this->libelle;
}
public function setIdImport(?string $idImport): ZoneLivraison
{
$this->idImport = $idImport;
return $this;
}
public function getIdImport(): ?string
{
return $this->idImport;
}
public function setReference(?string $reference): ZoneLivraison
{
$this->reference = $reference;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
}