<?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;
/**
* Modele
*
* @ORM\Table("vehicule__modele")
* @ORM\Entity(repositoryClass="App\Repository\Vehicules\ModeleRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Modele", group="VEHICULES")
*/
class Modele
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Vehicules\Application", mappedBy="modele")
*/
private $articleApplication;
/**
* @ORM\Column(name="statut", type="boolean", nullable=true)
*/
private $statut;
/**
* @ORM\Column(name="site_web", type="boolean", nullable=true)
*/
private $siteWeb;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Vehicules\Type", mappedBy="modele")
* @ORM\OrderBy({"ordre" = "ASC"})
*/
private $type;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Vehicules\Marque", inversedBy="modele")
* @ORM\JoinColumn(nullable=true)
*/
private $marque;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Vehicules\VehiculeClient", mappedBy="modele")
*/
private $vehiculeClient;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="modelesVehicule")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="logo", type="string", length=255, nullable=true)
*/
private $logo;
/**
* @ORM\Column(name="libelle", type="string", length=255, nullable=true)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @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="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @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->type = new ArrayCollection();
$this->vehiculeClient = new ArrayCollection();
}
public function __toString()
{
return $this->libelle;
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): Modele
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(?DateTime $date): Modele
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): Modele
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): Modele
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setLogo(?string $logo): Modele
{
$this->logo = $logo;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function getLogoDir(): string
{
return 'uploads/logos/modele';
}
public function setUtilisateur(?Utilisateur $utilisateur): Modele
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addVehiculeClient(VehiculeClient $vehiculeClient): Modele
{
$this->vehiculeClient[] = $vehiculeClient;
return $this;
}
public function removeVehiculeClient(VehiculeClient $vehiculeClient)
{
$this->vehiculeClient->removeElement($vehiculeClient);
}
public function getVehiculeClient(): Collection
{
return $this->vehiculeClient;
}
public function addType(Type $type): Modele
{
$this->type[] = $type;
return $this;
}
public function removeType(Type $type)
{
$this->type->removeElement($type);
}
public function getType(): Collection
{
return $this->type;
}
public function setMarque(?Marque $marque): Modele
{
$this->marque = $marque;
return $this;
}
public function getMarque(): ?Marque
{
return $this->marque;
}
public function addArticleApplication(Application $articleApplication): Modele
{
$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): Modele
{
$this->statut = $statut;
return $this;
}
public function getStatut(): ?bool
{
return $this->statut;
}
public function setIdImport(?string $idImport): Modele
{
$this->idImport = $idImport;
return $this;
}
public function getIdImport(): ?string
{
return $this->idImport;
}
public function setReference(?string $reference): Modele
{
$this->reference = $reference;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setOrdre(?int $ordre): Modele
{
$this->ordre = $ordre;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setSiteWeb(?bool $siteWeb): Modele
{
$this->siteWeb = $siteWeb;
return $this;
}
public function getSiteWeb(): ?bool
{
return $this->siteWeb;
}
}