src/Entity/Vehicules/Type.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Vehicules;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use Datetime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use App\Annotations\SecuredEntity;
  11. /**
  12.  * Type
  13.  *
  14.  * @ORM\Table("vehicule__type")
  15.  * @ORM\Entity(repositoryClass="App\Repository\Vehicules\TypeRepository")
  16.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  17.  * @SecuredEntity(name="Type", group="VEHICULES")
  18.  */
  19. class Type
  20. {
  21.     /**
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.      /**
  28.      * @ORM\OneToMany(targetEntity="App\Entity\Vehicules\Application", mappedBy="type")
  29.      */
  30.     private $articleApplication;
  31.     
  32.     /**
  33.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  34.      */
  35.     private $statut;    
  36.     
  37.     /**
  38.      * @ORM\Column(name="site_web", type="boolean", nullable=true)
  39.      */
  40.     private $siteWeb;
  41.     
  42.     /**
  43.      * @ORM\Column(name="logo", type="string", length=255, nullable=true)
  44.      */
  45.     private $logo;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity="App\Entity\Vehicules\Modele", inversedBy="type")
  48.      * @ORM\JoinColumn(nullable=true)
  49.      * @Assert\NotBlank(message="Modèle de véhicule obligatoire")
  50.      */
  51.     private $modele;
  52.     
  53.     /**
  54.      * @ORM\ManyToOne(targetEntity="App\Entity\Vehicules\Marque", inversedBy="type")
  55.      * @ORM\JoinColumn(nullable=true)
  56.      * @Assert\NotBlank(message="Marque de véhicule obligatoire")
  57.      */
  58.     private $marque;
  59.     /**
  60.      * @ORM\OneToMany(targetEntity="App\Entity\Vehicules\VehiculeClient", mappedBy="type")
  61.      */
  62.     private $vehiculeClient;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="typesVehicule")
  65.      * @ORM\JoinColumn(nullable=true)
  66.      */
  67.     private $utilisateur;
  68.     /**
  69.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  70.      * @Assert\NotBlank(message="Libellé obligatoire")
  71.      */
  72.     private $libelle;
  73.     
  74.     /**
  75.      * @ORM\Column(name="ktype", type="string", length=255, nullable=true)
  76.      * @Assert\NotBlank(message="Ktype obligatoire")
  77.      */
  78.     private $ktype;
  79.     
  80.     /**
  81.      * @ORM\Column(name="periode_production", type="string", length=255, nullable=true)
  82.      */
  83.     private $periodeProduction;
  84.     
  85.     /**
  86.      * @ORM\Column(name="motorisation", type="string", length=255, nullable=true)
  87.      */
  88.     private $motorisation;
  89.     
  90.     /**
  91.      * @ORM\Column(name="plateforme", type="string", length=255, nullable=true)
  92.      */
  93.     private $plateforme;
  94.     
  95.     /**
  96.      * @ORM\Column(name="epid", type="string", length=255, nullable=true)
  97.      */
  98.     private $epid;
  99.     /**
  100.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  101.      */
  102.     private $idImport;
  103.     
  104.     /**
  105.      * @ORM\Column(name="reference", type="string", length=255, nullable=true)
  106.      */
  107.     private $reference;
  108.     /**
  109.      * @ORM\Column(name="date", type="datetime", nullable=true)
  110.      */
  111.     private $date;
  112.     /**
  113.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  114.      * @Gedmo\Timestampable(on="update")  
  115.      */
  116.     private $dateMaj;
  117.     /**
  118.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  119.      */
  120.     private $dateSuppression;
  121.     
  122.     /**
  123.      * @ORM\Column(name="marque_libelle", type="string", length=255, nullable=true)
  124.      */
  125.     private $marqueLibelle;
  126.     
  127.     /**
  128.      * @ORM\Column(name="modele_libelle", type="string", length=255, nullable=true)
  129.      */
  130.     private $modeleLibelle;
  131.     
  132.     /**
  133.      * @ORM\Column(name="type_modele_libelle", type="string", length=255, nullable=true)
  134.      */
  135.     private $typeModeleLibelle;
  136.     
  137.     /**
  138.      * @ORM\Column(name="type_moteur_libelle", type="string", length=255, nullable=true)
  139.      */
  140.     private $typeMoteurLibelle;
  141.     
  142.     /**
  143.      * @ORM\Column(name="annee", type="string", length=255, nullable=true)
  144.      */
  145.     private $annee;
  146.     /**
  147.      * @ORM\Column(name="ordre", type="integer",nullable=true)
  148.      */
  149.     private $ordre;
  150.     public function __construct()
  151.     {
  152.         $this->date                 = new Datetime();
  153.         $this->siteWeb              false;
  154.         $this->statut               true;
  155.         $this->articleApplication   = new ArrayCollection();
  156.         $this->vehiculeClient       = new ArrayCollection();
  157.     }
  158.     public function __toString() {
  159.         return $this->libelle;
  160.     }
  161.     public function getId(): int
  162.     {
  163.         return $this->id;
  164.     }
  165.     public function setLibelle(?string $libelle): Type
  166.     {
  167.         $this->libelle $libelle;
  168.         return $this;
  169.     }
  170.     public function getLibelle(): ?string
  171.     {
  172.         return $this->libelle;
  173.     }
  174.     public function setDate(?Datetime $date): Type
  175.     {
  176.         $this->date $date;
  177.         return $this;
  178.     }
  179.     public function getDate(): ?Datetime
  180.     {
  181.         return $this->date;
  182.     }
  183.     public function setDateMaj(?Datetime $dateMaj): Type
  184.     {
  185.         $this->dateMaj $dateMaj;
  186.         return $this;
  187.     }
  188.     public function getDateMaj(): ?Datetime
  189.     {
  190.         return $this->dateMaj;
  191.     }
  192.     public function setDateSuppression(?Datetime $dateSuppression): Type
  193.     {
  194.         $this->dateSuppression $dateSuppression;
  195.         return $this;
  196.     }
  197.     public function getDateSuppression(): ?Datetime
  198.     {
  199.         return $this->dateSuppression;
  200.     }
  201.     public function setUtilisateur(?Utilisateur $utilisateur): Type
  202.     {
  203.         $this->utilisateur $utilisateur;
  204.         return $this;
  205.     }
  206.     public function getUtilisateur(): ?Utilisateur
  207.     {
  208.         return $this->utilisateur;
  209.     }
  210.     public function addVehiculeClient(VehiculeClient $vehiculeClient): Type
  211.     {
  212.         $this->vehiculeClient[] = $vehiculeClient;
  213.         return $this;
  214.     }
  215.     public function removeVehiculeClient(VehiculeClient $vehiculeClient)
  216.     {
  217.         $this->vehiculeClient->removeElement($vehiculeClient);
  218.     }
  219.     public function getVehiculeClient(): Collection
  220.     {
  221.         return $this->vehiculeClient;
  222.     }
  223.     public function setModele(?Modele $modele): Type
  224.     {
  225.         $this->modele $modele;
  226.         return $this;
  227.     }
  228.     public function getModele(): ?Modele
  229.     {
  230.         return $this->modele;
  231.     }
  232.     public function setMarque(?Marque $marque): Type
  233.     {
  234.         $this->marque $marque;
  235.         return $this;
  236.     }
  237.     public function getMarque(): ?Marque
  238.     {
  239.         return $this->marque;
  240.     }
  241.     public function addArticleApplication(Application $articleApplication): Type
  242.     {
  243.         $this->articleApplication[] = $articleApplication;
  244.         return $this;
  245.     }
  246.     public function removeArticleApplication(Application $articleApplication)
  247.     {
  248.         $this->articleApplication->removeElement($articleApplication);
  249.     }
  250.     public function getArticleApplication(): Collection
  251.     {
  252.         return $this->articleApplication;
  253.     }
  254.     public function setStatut(?bool $statut): Type
  255.     {
  256.         $this->statut $statut;
  257.         return $this;
  258.     }
  259.     public function getStatut(): ?bool
  260.     {
  261.         return $this->statut;
  262.     }
  263.     public function setMarqueLibelle(?string $marqueLibelle): Type
  264.     {
  265.         $this->marqueLibelle $marqueLibelle;
  266.         return $this;
  267.     }
  268.     public function getMarqueLibelle(): ?string
  269.     {
  270.         return $this->marqueLibelle;
  271.     }
  272.     public function setModeleLibelle(?string $modeleLibelle): Type
  273.     {
  274.         $this->modeleLibelle $modeleLibelle;
  275.         return $this;
  276.     }
  277.     public function getModeleLibelle(): ?string
  278.     {
  279.         return $this->modeleLibelle;
  280.     }
  281.     public function setTypeModeleLibelle(?string $typeModeleLibelle): Type
  282.     {
  283.         $this->typeModeleLibelle $typeModeleLibelle;
  284.         return $this;
  285.     }
  286.     public function getTypeModeleLibelle(): ?string
  287.     {
  288.         return $this->typeModeleLibelle;
  289.     }
  290.     public function setTypeMoteurLibelle(?string $typeMoteurLibelle): Type
  291.     {
  292.         $this->typeMoteurLibelle $typeMoteurLibelle;
  293.         return $this;
  294.     }
  295.     public function getTypeMoteurLibelle(): ?string
  296.     {
  297.         return $this->typeMoteurLibelle;
  298.     }
  299.     public function setAnnee(?string $annee): Type
  300.     {
  301.         $this->annee $annee;
  302.         return $this;
  303.     }
  304.     public function getAnnee(): ?string
  305.     {
  306.         return $this->annee;
  307.     }
  308.     public function setIdImport(?string $idImport): Type
  309.     {
  310.         $this->idImport $idImport;
  311.         return $this;
  312.     }
  313.     public function getIdImport(): ?string
  314.     {
  315.         return $this->idImport;
  316.     }
  317.     public function setReference(?string $reference): Type
  318.     {
  319.         $this->reference $reference;
  320.         return $this;
  321.     }
  322.     public function getReference(): ?string
  323.     {
  324.         return $this->reference;
  325.     }
  326.     public function setLogo(?string $logo): Type
  327.     {
  328.         $this->logo $logo;
  329.         return $this;
  330.     }
  331.     public function getLogo(): ?string
  332.     {
  333.         return $this->logo;
  334.     }
  335.     
  336.     public function getLogoDir(): string
  337.     {
  338.         return 'uploads/logos/typevehicule';
  339.     }    
  340.     public function setOrdre(?int $ordre): Type
  341.     {
  342.         $this->ordre $ordre;
  343.         return $this;
  344.     }
  345.     public function getOrdre(): ?int
  346.     {
  347.         return $this->ordre;
  348.     }
  349.     public function setSiteWeb(?bool $siteWeb): Type
  350.     {
  351.         $this->siteWeb $siteWeb;
  352.         return $this;
  353.     }
  354.     public function getSiteWeb(): ?bool
  355.     {
  356.         return $this->siteWeb;
  357.     }
  358.     public function setKtype(?string $ktype): Type
  359.     {
  360.         $this->ktype $ktype;
  361.         return $this;
  362.     }
  363.     public function getKtype(): ?string
  364.     {
  365.         return $this->ktype;
  366.     }
  367.     public function setPlateforme(?string $plateforme): Type
  368.     {
  369.         $this->plateforme $plateforme;
  370.         return $this;
  371.     }
  372.     public function getPlateforme(): ?string
  373.     {
  374.         return $this->plateforme;
  375.     }
  376.     public function setEpid(?string $epid): Type
  377.     {
  378.         $this->epid $epid;
  379.         return $this;
  380.     }
  381.     public function getEpid(): ?string
  382.     {
  383.         return $this->epid;
  384.     }
  385.     public function setPeriodeProduction(?string $periodeProduction): Type
  386.     {
  387.         $this->periodeProduction $periodeProduction;
  388.         return $this;
  389.     }
  390.     public function getPeriodeProduction(): ?string
  391.     {
  392.         return $this->periodeProduction;
  393.     }
  394.     public function setMotorisation(?string $motorisation): Type
  395.     {
  396.         $this->motorisation $motorisation;
  397.         return $this;
  398.     }
  399.     public function getMotorisation(): ?string
  400.     {
  401.         return $this->motorisation;
  402.     }
  403. }