<?php
namespace App\Entity\Vehicules;
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;
/**
* Type
*
* @ORM\Table("vehicule__type")
* @ORM\Entity(repositoryClass="App\Repository\Vehicules\TypeRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Type", group="VEHICULES")
*/
class Type
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Vehicules\Application", mappedBy="type")
*/
private $articleApplication;
/**
* @ORM\Column(name="statut", type="boolean", nullable=true)
*/
private $statut;
/**
* @ORM\Column(name="site_web", type="boolean", nullable=true)
*/
private $siteWeb;
/**
* @ORM\Column(name="logo", type="string", length=255, nullable=true)
*/
private $logo;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Vehicules\Modele", inversedBy="type")
* @ORM\JoinColumn(nullable=true)
* @Assert\NotBlank(message="Modèle de véhicule obligatoire")
*/
private $modele;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Vehicules\Marque", inversedBy="type")
* @ORM\JoinColumn(nullable=true)
* @Assert\NotBlank(message="Marque de véhicule obligatoire")
*/
private $marque;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Vehicules\VehiculeClient", mappedBy="type")
*/
private $vehiculeClient;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="typesVehicule")
* @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="ktype", type="string", length=255, nullable=true)
* @Assert\NotBlank(message="Ktype obligatoire")
*/
private $ktype;
/**
* @ORM\Column(name="periode_production", type="string", length=255, nullable=true)
*/
private $periodeProduction;
/**
* @ORM\Column(name="motorisation", type="string", length=255, nullable=true)
*/
private $motorisation;
/**
* @ORM\Column(name="plateforme", type="string", length=255, nullable=true)
*/
private $plateforme;
/**
* @ORM\Column(name="epid", type="string", length=255, nullable=true)
*/
private $epid;
/**
* @ORM\Column(name="id_import", type="string",length=255, nullable=true)
*/
private $idImport;
/**
* @ORM\Column(name="reference", type="string", length=255, nullable=true)
*/
private $reference;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="marque_libelle", type="string", length=255, nullable=true)
*/
private $marqueLibelle;
/**
* @ORM\Column(name="modele_libelle", type="string", length=255, nullable=true)
*/
private $modeleLibelle;
/**
* @ORM\Column(name="type_modele_libelle", type="string", length=255, nullable=true)
*/
private $typeModeleLibelle;
/**
* @ORM\Column(name="type_moteur_libelle", type="string", length=255, nullable=true)
*/
private $typeMoteurLibelle;
/**
* @ORM\Column(name="annee", type="string", length=255, nullable=true)
*/
private $annee;
/**
* @ORM\Column(name="ordre", type="integer",nullable=true)
*/
private $ordre;
public function __construct()
{
$this->date = new Datetime();
$this->siteWeb = false;
$this->statut = true;
$this->articleApplication = new ArrayCollection();
$this->vehiculeClient = new ArrayCollection();
}
public function __toString() {
return $this->libelle;
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): Type
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(?Datetime $date): Type
{
$this->date = $date;
return $this;
}
public function getDate(): ?Datetime
{
return $this->date;
}
public function setDateMaj(?Datetime $dateMaj): Type
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?Datetime
{
return $this->dateMaj;
}
public function setDateSuppression(?Datetime $dateSuppression): Type
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?Datetime
{
return $this->dateSuppression;
}
public function setUtilisateur(?Utilisateur $utilisateur): Type
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addVehiculeClient(VehiculeClient $vehiculeClient): Type
{
$this->vehiculeClient[] = $vehiculeClient;
return $this;
}
public function removeVehiculeClient(VehiculeClient $vehiculeClient)
{
$this->vehiculeClient->removeElement($vehiculeClient);
}
public function getVehiculeClient(): Collection
{
return $this->vehiculeClient;
}
public function setModele(?Modele $modele): Type
{
$this->modele = $modele;
return $this;
}
public function getModele(): ?Modele
{
return $this->modele;
}
public function setMarque(?Marque $marque): Type
{
$this->marque = $marque;
return $this;
}
public function getMarque(): ?Marque
{
return $this->marque;
}
public function addArticleApplication(Application $articleApplication): Type
{
$this->articleApplication[] = $articleApplication;
return $this;
}
public function removeArticleApplication(Application $articleApplication)
{
$this->articleApplication->removeElement($articleApplication);
}
public function getArticleApplication(): Collection
{
return $this->articleApplication;
}
public function setStatut(?bool $statut): Type
{
$this->statut = $statut;
return $this;
}
public function getStatut(): ?bool
{
return $this->statut;
}
public function setMarqueLibelle(?string $marqueLibelle): Type
{
$this->marqueLibelle = $marqueLibelle;
return $this;
}
public function getMarqueLibelle(): ?string
{
return $this->marqueLibelle;
}
public function setModeleLibelle(?string $modeleLibelle): Type
{
$this->modeleLibelle = $modeleLibelle;
return $this;
}
public function getModeleLibelle(): ?string
{
return $this->modeleLibelle;
}
public function setTypeModeleLibelle(?string $typeModeleLibelle): Type
{
$this->typeModeleLibelle = $typeModeleLibelle;
return $this;
}
public function getTypeModeleLibelle(): ?string
{
return $this->typeModeleLibelle;
}
public function setTypeMoteurLibelle(?string $typeMoteurLibelle): Type
{
$this->typeMoteurLibelle = $typeMoteurLibelle;
return $this;
}
public function getTypeMoteurLibelle(): ?string
{
return $this->typeMoteurLibelle;
}
public function setAnnee(?string $annee): Type
{
$this->annee = $annee;
return $this;
}
public function getAnnee(): ?string
{
return $this->annee;
}
public function setIdImport(?string $idImport): Type
{
$this->idImport = $idImport;
return $this;
}
public function getIdImport(): ?string
{
return $this->idImport;
}
public function setReference(?string $reference): Type
{
$this->reference = $reference;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setLogo(?string $logo): Type
{
$this->logo = $logo;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function getLogoDir(): string
{
return 'uploads/logos/typevehicule';
}
public function setOrdre(?int $ordre): Type
{
$this->ordre = $ordre;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setSiteWeb(?bool $siteWeb): Type
{
$this->siteWeb = $siteWeb;
return $this;
}
public function getSiteWeb(): ?bool
{
return $this->siteWeb;
}
public function setKtype(?string $ktype): Type
{
$this->ktype = $ktype;
return $this;
}
public function getKtype(): ?string
{
return $this->ktype;
}
public function setPlateforme(?string $plateforme): Type
{
$this->plateforme = $plateforme;
return $this;
}
public function getPlateforme(): ?string
{
return $this->plateforme;
}
public function setEpid(?string $epid): Type
{
$this->epid = $epid;
return $this;
}
public function getEpid(): ?string
{
return $this->epid;
}
public function setPeriodeProduction(?string $periodeProduction): Type
{
$this->periodeProduction = $periodeProduction;
return $this;
}
public function getPeriodeProduction(): ?string
{
return $this->periodeProduction;
}
public function setMotorisation(?string $motorisation): Type
{
$this->motorisation = $motorisation;
return $this;
}
public function getMotorisation(): ?string
{
return $this->motorisation;
}
}