src/Entity/Transporteurs/ZoneLivraison.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Transporteurs;
  3. use App\Entity\Localisation\Zone;
  4. use App\Entity\Utilisateur\Utilisateur;
  5. use DateTime;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use App\Annotations\SecuredEntity;
  12. /**
  13.  * ZoneLivraison
  14.  *
  15.  * @ORM\Table("transporteur__zone_livraison")
  16.  * @ORM\Entity(repositoryClass="App\Repository\Transporteurs\ZoneLivraisonRepository")
  17.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  18.  * @SecuredEntity(name="Zone de Livraison", group="TRANSPORTEURS")
  19.  */
  20. class ZoneLivraison
  21. {
  22.     /**
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     
  29.     /**
  30.      * @ORM\Column(name="reference", type="string", length=255, nullable=true)
  31.      */
  32.     private $reference;
  33.     
  34.     /**
  35.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  36.      */
  37.     private $idImport;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="App\Entity\Localisation\Zone", mappedBy="zoneLivraison")
  40.      */
  41.     private $zoneLocalisation;
  42.     
  43.     /**
  44.      * @ORM\OneToMany(targetEntity="App\Entity\Transporteurs\TransporteurZoneLivraison", mappedBy="zoneLivraison")
  45.      */
  46.     private $transporteurZoneLivraison;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="zoneLivraison")
  49.      * @ORM\JoinColumn(nullable=true)
  50.      */
  51.     private $utilisateur;
  52.     /**
  53.      * @ORM\Column(name="libelle", type="string", length=255,nullable=true)
  54.      * @Assert\NotBlank(message="LibellĂ© obligatoire")
  55.      */
  56.     private $libelle;
  57.     /**
  58.      * @ORM\Column(name="date", type="datetime")
  59.      */
  60.     private $date;
  61.     /**
  62.      * @ORM\Column(name="dateSuppression", type="datetime",nullable=true)
  63.      */
  64.     private $dateSuppression;
  65.     /**
  66.      * @ORM\Column(name="dateMaj", type="datetime",nullable=true)
  67.      * @Gedmo\Timestampable(on="update")
  68.      */
  69.     private $dateMaj;
  70.     /**
  71.      * @ORM\Column(name="code_iso",type="string", length=255, nullable=true)
  72.      */
  73.     private $codeIso;
  74.     /**
  75.      * @ORM\Column(type="integer", nullable=true)
  76.      */
  77.     private $typeZoneLivraison;
  78.     public function __construct()
  79.                       {
  80.                           $this->date                         = new Datetime();
  81.                           $this->transporteurZoneLivraison    = new ArrayCollection();
  82.                           $this->zoneLocalisation             = new ArrayCollection();
  83.                       }
  84.     public function getId(): int
  85.     {
  86.         return $this->id;
  87.     }
  88.     public function setLibelle(?string $libelle): ZoneLivraison
  89.     {
  90.         $this->libelle $libelle;
  91.         return $this;
  92.     }
  93.     public function getLibelle(): ?string
  94.     {
  95.         return $this->libelle;
  96.     }
  97.     public function setDate(DateTime $date): ZoneLivraison
  98.     {
  99.         $this->date $date;
  100.         return $this;
  101.     }
  102.     public function getDate(): DateTime
  103.     {
  104.         return $this->date;
  105.     }
  106.     public function setDateSuppression(?DateTime $dateSuppression): ZoneLivraison
  107.     {
  108.         $this->dateSuppression $dateSuppression;
  109.         return $this;
  110.     }
  111.     public function getDateSuppression(): ?DateTime
  112.     {
  113.         return $this->dateSuppression;
  114.     }
  115.     public function setDateMaj(?DateTime $dateMaj): ZoneLivraison
  116.     {
  117.         $this->dateMaj $dateMaj;
  118.         return $this;
  119.     }
  120.     public function getDateMaj(): ?DateTime
  121.     {
  122.         return $this->dateMaj;
  123.     }
  124.     public function setUtilisateur(?Utilisateur $utilisateur): ZoneLivraison
  125.     {
  126.         $this->utilisateur $utilisateur;
  127.         return $this;
  128.     }
  129.     public function getUtilisateur(): ?Utilisateur
  130.     {
  131.         return $this->utilisateur;
  132.     }
  133.     public function addZoneLocalisation(Zone $zoneLocalisation): ZoneLivraison
  134.     {
  135.         $this->zoneLocalisation[] = $zoneLocalisation;
  136.         return $this;
  137.     }
  138.     public function removeZoneLocalisation(Zone $zoneLocalisation)
  139.     {
  140.         $this->zoneLocalisation->removeElement($zoneLocalisation);
  141.     }
  142.     public function getZoneLocalisation(): Collection
  143.     {
  144.         return $this->zoneLocalisation;
  145.     }
  146.     public function addTransporteurZoneLivraison(ZoneLivraison $transporteurZoneLivraison): ZoneLivraison
  147.     {
  148.         $this->transporteurZoneLivraison[] = $transporteurZoneLivraison;
  149.         return $this;
  150.     }
  151.     public function removeTransporteurZoneLivraison(ZoneLivraison $transporteurZoneLivraison)
  152.     {
  153.         $this->transporteurZoneLivraison->removeElement($transporteurZoneLivraison);
  154.     }
  155.     public function getTransporteurZoneLivraison(): Collection
  156.     {
  157.         return $this->transporteurZoneLivraison;
  158.     }
  159.     
  160.     public function __toString() {
  161.         return $this->libelle;
  162.     }
  163.     public function setIdImport(?string $idImport): ZoneLivraison
  164.     {
  165.         $this->idImport $idImport;
  166.         return $this;
  167.     }
  168.     public function getIdImport(): ?string
  169.     {
  170.         return $this->idImport;
  171.     }
  172.     public function setReference(?string $reference): ZoneLivraison
  173.     {
  174.         $this->reference $reference;
  175.         return $this;
  176.     }
  177.     public function getReference(): ?string
  178.     {
  179.         return $this->reference;
  180.     }
  181.     public function getCodeIso(): ?string
  182.     {
  183.         return $this->codeIso;
  184.     }
  185.     public function setCodeIso(?string $codeIso): self
  186.     {
  187.         $this->codeIso $codeIso;
  188.         return $this;
  189.     }
  190.     public function getTypeZoneLivraison(): ?int
  191.     {
  192.         return $this->typeZoneLivraison;
  193.     }
  194.     public function setTypeZoneLivraison(?int $typeZoneLivraison): self
  195.     {
  196.         $this->typeZoneLivraison $typeZoneLivraison;
  197.         return $this;
  198.     }
  199. }