src/Entity/Vehicules/Marque.php line 21

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.  * Marque
  13.  *
  14.  * @ORM\Table("vehicule__marque")
  15.  * @ORM\Entity(repositoryClass="App\Repository\Vehicules\MarqueRepository")
  16.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  17.  * @SecuredEntity(name="Marque", group="VEHICULES")
  18.  */
  19. class Marque
  20. {
  21.     /**
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id
  27.     
  28.     /**
  29.      * @ORM\OneToMany(targetEntity="App\Entity\Vehicules\Application", mappedBy="marque")
  30.      */
  31.     private $articleApplication;
  32.     
  33.     /**
  34.      * @ORM\Column(name="home_page_prestashop", type="boolean", nullable=true)
  35.      */
  36.     private $homePagePrestashop;
  37.     
  38.     /**
  39.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  40.      */
  41.     private $statut
  42.     
  43.     /**
  44.      * @ORM\Column(name="site_web", type="boolean", nullable=true)
  45.      */
  46.     private $siteWeb;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity="App\Entity\Vehicules\Modele", mappedBy="marque")
  49.      * @ORM\OrderBy({"ordre" = "ASC"})
  50.      */
  51.     private $modele;
  52.     
  53.     /**
  54.      * @ORM\OneToMany(targetEntity="App\Entity\Vehicules\Type", mappedBy="marque")
  55.      */
  56.     private $type;
  57.     
  58.     /**
  59.      * @ORM\OneToMany(targetEntity="App\Entity\Vehicules\VehiculeClient", mappedBy="marque")
  60.      */
  61.     private $vehiculeClient;
  62.     /**
  63.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="marquesVehicule")
  64.      * @ORM\JoinColumn(nullable=true)
  65.      */
  66.     private $utilisateur;
  67.     /**
  68.      * @ORM\Column(name="logo", type="string", length=255, nullable=true)
  69.      */
  70.     private $logo;
  71.     
  72.     /**
  73.      * @ORM\Column(name="ordre", type="integer",nullable=true)
  74.      */
  75.     private $ordre;
  76.     
  77.     /**
  78.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  79.      * @Assert\NotBlank(message="LibellĂ© obligatoire")
  80.      */
  81.     private $libelle;
  82.     
  83.     /**
  84.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  85.      */
  86.     private $idImport;
  87.     
  88.     /**
  89.      * @ORM\Column(name="reference", type="string", length=255, nullable=true)
  90.      */
  91.     private $reference;
  92.     /**
  93.      * @ORM\Column(name="date", type="datetime", nullable=true)
  94.      */
  95.     private $date;
  96.     /**
  97.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  98.      * @Gedmo\Timestampable(on="update")     
  99.      */
  100.     private $dateMaj;
  101.     /**
  102.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  103.      */
  104.     private $dateSuppression;
  105.     public function __construct()
  106.     {
  107.         $this->date                 = new Datetime();
  108.         $this->siteWeb              false;
  109.         $this->statut               true;
  110.         $this->vehiculeClient       = new ArrayCollection();
  111.         $this->type                 = new ArrayCollection();
  112.         $this->modele               = new ArrayCollection();
  113.         $this->articleApplication   = new ArrayCollection();
  114.     }
  115.     public function getId(): int
  116.     {
  117.         return $this->id;
  118.     }
  119.     public function setLibelle(?string $libelle): Marque
  120.     {
  121.         $this->libelle $libelle;
  122.         return $this;
  123.     }
  124.     public function getLibelle(): ?string
  125.     {
  126.         return $this->libelle;
  127.     }
  128.     public function setDate(?DateTime $date): Marque
  129.     {
  130.         $this->date $date;
  131.         return $this;
  132.     }
  133.     public function getDate(): ?DateTime
  134.     {
  135.         return $this->date;
  136.     }
  137.     public function setDateMaj(?DateTime $dateMaj): Marque
  138.     {
  139.         $this->dateMaj $dateMaj;
  140.         return $this;
  141.     }
  142.     public function getDateMaj(): ?DateTime
  143.     {
  144.         return $this->dateMaj;
  145.     }
  146.     public function setDateSuppression(?DateTime $dateSuppression): Marque
  147.     {
  148.         $this->dateSuppression $dateSuppression;
  149.         return $this;
  150.     }
  151.     public function getDateSuppression(): ?DateTime
  152.     {
  153.         return $this->dateSuppression;
  154.     }
  155.     public function setLogo(?string $logo): Marque
  156.     {
  157.         $this->logo $logo;
  158.         return $this;
  159.     }
  160.     public function getLogo(): ?string
  161.     {
  162.         return $this->logo;
  163.     }
  164.     
  165.     public function getLogoDir(): string
  166.     {
  167.         return 'uploads/logos/marque';
  168.     }
  169.     public function setUtilisateur(?Utilisateur $utilisateur): Marque
  170.     {
  171.         $this->utilisateur $utilisateur;
  172.         return $this;
  173.     }
  174.     public function getUtilisateur(): ?Utilisateur
  175.     {
  176.         return $this->utilisateur;
  177.     }
  178.     public function __toString() {
  179.         return $this->libelle;
  180.     }
  181.     public function addArticleApplication(Application $articleApplication): Marque
  182.     {
  183.         $this->articleApplication[] = $articleApplication;
  184.         return $this;
  185.     }
  186.     public function removeArticleApplication(Application $articleApplication)
  187.     {
  188.         $this->articleApplication->removeElement($articleApplication);
  189.     }
  190.     public function getArticleApplication(): Collection
  191.     {
  192.         return $this->articleApplication;
  193.     }
  194.     public function addModele(Modele $modele): Marque
  195.     {
  196.         $this->modele[] = $modele;
  197.         return $this;
  198.     }
  199.     public function removeModele(Modele $modele)
  200.     {
  201.         $this->modele->removeElement($modele);
  202.     }
  203.     public function getModele(): Collection
  204.     {
  205.         return $this->modele;
  206.     }
  207.     public function addType(Type $type): Marque
  208.     {
  209.         $this->type[] = $type;
  210.         return $this;
  211.     }
  212.     public function removeType(Type $type)
  213.     {
  214.         $this->type->removeElement($type);
  215.     }
  216.     public function getType(): Collection
  217.     {
  218.         return $this->type;
  219.     }
  220.     public function addVehiculeClient(VehiculeClient $vehiculeClient): Marque
  221.     {
  222.         $this->vehiculeClient[] = $vehiculeClient;
  223.         return $this;
  224.     }
  225.     public function removeVehiculeClient(VehiculeClient $vehiculeClient)
  226.     {
  227.         $this->vehiculeClient->removeElement($vehiculeClient);
  228.     }
  229.     public function getVehiculeClient(): Collection
  230.     {
  231.         return $this->vehiculeClient;
  232.     }
  233.     public function setStatut(?bool $statut): Marque
  234.     {
  235.         $this->statut $statut;
  236.         return $this;
  237.     }
  238.     public function getStatut(): ?bool
  239.     {
  240.         return $this->statut;
  241.     }
  242.     public function setOrdre(?int $ordre): Marque
  243.     {
  244.         $this->ordre $ordre;
  245.         return $this;
  246.     }
  247.     public function getOrdre(): ?int
  248.     {
  249.         return $this->ordre;
  250.     }
  251.     public function setIdImport(?string $idImport): Marque
  252.     {
  253.         $this->idImport $idImport;
  254.         return $this;
  255.     }
  256.     public function getIdImport(): ?string
  257.     {
  258.         return $this->idImport;
  259.     }
  260.     public function setReference(?string $reference): Marque
  261.     {
  262.         $this->reference $reference;
  263.         return $this;
  264.     }
  265.     public function getReference(): ?string
  266.     {
  267.         return $this->reference;
  268.     }
  269.     public function setHomePagePrestashop(?bool $homePagePrestashop): Marque
  270.     {
  271.         $this->homePagePrestashop $homePagePrestashop;
  272.         return $this;
  273.     }
  274.     public function getHomePagePrestashop(): ?bool
  275.     {
  276.         return $this->homePagePrestashop;
  277.     }
  278.     public function setSiteWeb(?bool $siteWeb): Marque
  279.     {
  280.         $this->siteWeb $siteWeb;
  281.         return $this;
  282.     }
  283.     public function getSiteWeb(): ?bool
  284.     {
  285.         return $this->siteWeb;
  286.     }
  287. }