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.      */
  77.     private $ktype;
  78.     
  79.     /**
  80.      * @ORM\Column(name="periode_production", type="string", length=255, nullable=true)
  81.      */
  82.     private $periodeProduction;
  83.     
  84.     /**
  85.      * @ORM\Column(name="motorisation", type="string", length=255, nullable=true)
  86.      */
  87.     private $motorisation;
  88.     
  89.     /**
  90.      * @ORM\Column(name="plateforme", type="string", length=255, nullable=true)
  91.      */
  92.     private $plateforme;
  93.     
  94.     /**
  95.      * @ORM\Column(name="epid", type="string", length=255, nullable=true)
  96.      */
  97.     private $epid;
  98.     /**
  99.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  100.      */
  101.     private $idImport;
  102.     
  103.     /**
  104.      * @ORM\Column(name="reference", type="string", length=255, nullable=true)
  105.      */
  106.     private $reference;
  107.     /**
  108.      * @ORM\Column(name="date", type="datetime", nullable=true)
  109.      */
  110.     private $date;
  111.     /**
  112.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  113.      * @Gedmo\Timestampable(on="update")  
  114.      */
  115.     private $dateMaj;
  116.     /**
  117.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  118.      */
  119.     private $dateSuppression;
  120.     
  121.     /**
  122.      * @ORM\Column(name="marque_libelle", type="string", length=255, nullable=true)
  123.      */
  124.     private $marqueLibelle;
  125.     
  126.     /**
  127.      * @ORM\Column(name="modele_libelle", type="string", length=255, nullable=true)
  128.      */
  129.     private $modeleLibelle;
  130.     
  131.     /**
  132.      * @ORM\Column(name="type_modele_libelle", type="string", length=255, nullable=true)
  133.      */
  134.     private $typeModeleLibelle;
  135.     
  136.     /**
  137.      * @ORM\Column(name="type_moteur_libelle", type="string", length=255, nullable=true)
  138.      */
  139.     private $typeMoteurLibelle;
  140.     
  141.     /**
  142.      * @ORM\Column(name="annee", type="string", length=255, nullable=true)
  143.      */
  144.     private $annee;
  145.     /**
  146.      * @ORM\Column(name="ordre", type="integer",nullable=true)
  147.      */
  148.     private $ordre;
  149.     public function __construct()
  150.     {
  151.         $this->date                 = new Datetime();
  152.         $this->siteWeb              false;
  153.         $this->statut               true;
  154.         $this->articleApplication   = new ArrayCollection();
  155.         $this->vehiculeClient       = new ArrayCollection();
  156.     }
  157.     public function __toString() {
  158.         return $this->libelle;
  159.     }
  160.     public function getId(): int
  161.     {
  162.         return $this->id;
  163.     }
  164.     public function setLibelle(?string $libelle): Type
  165.     {
  166.         $this->libelle $libelle;
  167.         return $this;
  168.     }
  169.     public function getLibelle(): ?string
  170.     {
  171.         return $this->libelle;
  172.     }
  173.     public function setDate(?Datetime $date): Type
  174.     {
  175.         $this->date $date;
  176.         return $this;
  177.     }
  178.     public function getDate(): ?Datetime
  179.     {
  180.         return $this->date;
  181.     }
  182.     public function setDateMaj(?Datetime $dateMaj): Type
  183.     {
  184.         $this->dateMaj $dateMaj;
  185.         return $this;
  186.     }
  187.     public function getDateMaj(): ?Datetime
  188.     {
  189.         return $this->dateMaj;
  190.     }
  191.     public function setDateSuppression(?Datetime $dateSuppression): Type
  192.     {
  193.         $this->dateSuppression $dateSuppression;
  194.         return $this;
  195.     }
  196.     public function getDateSuppression(): ?Datetime
  197.     {
  198.         return $this->dateSuppression;
  199.     }
  200.     public function setUtilisateur(?Utilisateur $utilisateur): Type
  201.     {
  202.         $this->utilisateur $utilisateur;
  203.         return $this;
  204.     }
  205.     public function getUtilisateur(): ?Utilisateur
  206.     {
  207.         return $this->utilisateur;
  208.     }
  209.     public function addVehiculeClient(VehiculeClient $vehiculeClient): Type
  210.     {
  211.         $this->vehiculeClient[] = $vehiculeClient;
  212.         return $this;
  213.     }
  214.     public function removeVehiculeClient(VehiculeClient $vehiculeClient)
  215.     {
  216.         $this->vehiculeClient->removeElement($vehiculeClient);
  217.     }
  218.     public function getVehiculeClient(): Collection
  219.     {
  220.         return $this->vehiculeClient;
  221.     }
  222.     public function setModele(?Modele $modele): Type
  223.     {
  224.         $this->modele $modele;
  225.         return $this;
  226.     }
  227.     public function getModele(): ?Modele
  228.     {
  229.         return $this->modele;
  230.     }
  231.     public function setMarque(?Marque $marque): Type
  232.     {
  233.         $this->marque $marque;
  234.         return $this;
  235.     }
  236.     public function getMarque(): ?Marque
  237.     {
  238.         return $this->marque;
  239.     }
  240.     public function addArticleApplication(Application $articleApplication): Type
  241.     {
  242.         $this->articleApplication[] = $articleApplication;
  243.         return $this;
  244.     }
  245.     public function removeArticleApplication(Application $articleApplication)
  246.     {
  247.         $this->articleApplication->removeElement($articleApplication);
  248.     }
  249.     public function getArticleApplication(): Collection
  250.     {
  251.         return $this->articleApplication;
  252.     }
  253.     public function setStatut(?bool $statut): Type
  254.     {
  255.         $this->statut $statut;
  256.         return $this;
  257.     }
  258.     public function getStatut(): ?bool
  259.     {
  260.         return $this->statut;
  261.     }
  262.     public function setMarqueLibelle(?string $marqueLibelle): Type
  263.     {
  264.         $this->marqueLibelle $marqueLibelle;
  265.         return $this;
  266.     }
  267.     public function getMarqueLibelle(): ?string
  268.     {
  269.         return $this->marqueLibelle;
  270.     }
  271.     public function setModeleLibelle(?string $modeleLibelle): Type
  272.     {
  273.         $this->modeleLibelle $modeleLibelle;
  274.         return $this;
  275.     }
  276.     public function getModeleLibelle(): ?string
  277.     {
  278.         return $this->modeleLibelle;
  279.     }
  280.     public function setTypeModeleLibelle(?string $typeModeleLibelle): Type
  281.     {
  282.         $this->typeModeleLibelle $typeModeleLibelle;
  283.         return $this;
  284.     }
  285.     public function getTypeModeleLibelle(): ?string
  286.     {
  287.         return $this->typeModeleLibelle;
  288.     }
  289.     public function setTypeMoteurLibelle(?string $typeMoteurLibelle): Type
  290.     {
  291.         $this->typeMoteurLibelle $typeMoteurLibelle;
  292.         return $this;
  293.     }
  294.     public function getTypeMoteurLibelle(): ?string
  295.     {
  296.         return $this->typeMoteurLibelle;
  297.     }
  298.     public function setAnnee(?string $annee): Type
  299.     {
  300.         $this->annee $annee;
  301.         return $this;
  302.     }
  303.     public function getAnnee(): ?string
  304.     {
  305.         return $this->annee;
  306.     }
  307.     public function setIdImport(?string $idImport): Type
  308.     {
  309.         $this->idImport $idImport;
  310.         return $this;
  311.     }
  312.     public function getIdImport(): ?string
  313.     {
  314.         return $this->idImport;
  315.     }
  316.     public function setReference(?string $reference): Type
  317.     {
  318.         $this->reference $reference;
  319.         return $this;
  320.     }
  321.     public function getReference(): ?string
  322.     {
  323.         return $this->reference;
  324.     }
  325.     public function setLogo(?string $logo): Type
  326.     {
  327.         $this->logo $logo;
  328.         return $this;
  329.     }
  330.     public function getLogo(): ?string
  331.     {
  332.         return $this->logo;
  333.     }
  334.     
  335.     public function getLogoDir(): string
  336.     {
  337.         return 'uploads/logos/typevehicule';
  338.     }    
  339.     public function setOrdre(?int $ordre): Type
  340.     {
  341.         $this->ordre $ordre;
  342.         return $this;
  343.     }
  344.     public function getOrdre(): ?int
  345.     {
  346.         return $this->ordre;
  347.     }
  348.     public function setSiteWeb(?bool $siteWeb): Type
  349.     {
  350.         $this->siteWeb $siteWeb;
  351.         return $this;
  352.     }
  353.     public function getSiteWeb(): ?bool
  354.     {
  355.         return $this->siteWeb;
  356.     }
  357.     public function setKtype(?string $ktype): Type
  358.     {
  359.         $this->ktype $ktype;
  360.         return $this;
  361.     }
  362.     public function getKtype(): ?string
  363.     {
  364.         return $this->ktype;
  365.     }
  366.     public function setPlateforme(?string $plateforme): Type
  367.     {
  368.         $this->plateforme $plateforme;
  369.         return $this;
  370.     }
  371.     public function getPlateforme(): ?string
  372.     {
  373.         return $this->plateforme;
  374.     }
  375.     public function setEpid(?string $epid): Type
  376.     {
  377.         $this->epid $epid;
  378.         return $this;
  379.     }
  380.     public function getEpid(): ?string
  381.     {
  382.         return $this->epid;
  383.     }
  384.     public function setPeriodeProduction(?string $periodeProduction): Type
  385.     {
  386.         $this->periodeProduction $periodeProduction;
  387.         return $this;
  388.     }
  389.     public function getPeriodeProduction(): ?string
  390.     {
  391.         return $this->periodeProduction;
  392.     }
  393.     public function setMotorisation(?string $motorisation): Type
  394.     {
  395.         $this->motorisation $motorisation;
  396.         return $this;
  397.     }
  398.     public function getMotorisation(): ?string
  399.     {
  400.         return $this->motorisation;
  401.     }
  402. }