<?php
namespace App\Entity;
use App\Repository\ProduitIMEIRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ProduitIMEIRepository::class)
*/
class ProduitIMEI
{
public const IMEIS_CONTROL_STATES_FILTERS = [
"IN_STOCK" => "En stock",
"SOLD" => "Vendu",
"DELETED" => "Supprimé",
];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Produit::class, inversedBy="produitIMEIs")
*/
private $produit;
/**
* @ORM\Column(type="string", length=255)
*/
private $imei;
/**
* @ORM\Column(type="date")
*/
private $dateEntree;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $dateSortie;
/**
* @ORM\ManyToOne(targetEntity=Siege::class, inversedBy="produitIMEIs")
*/
private $siege;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $dateTransfert;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $dateEntreeBoutique;
/**
* @ORM\OneToMany(targetEntity=StockUser::class, mappedBy="produitIMEI")
*/
private $stockUsers;
/**
* @ORM\OneToMany(targetEntity=TransfertPV::class, mappedBy="produitIMEI")
*/
private $transfertPVs;
/**
* @ORM\OneToMany(targetEntity=BlIMEI::class, mappedBy="produitIMEI")
*/
private $blIMEIs;
/**
* @ORM\OneToMany(targetEntity=TranfertCadeaux::class, mappedBy="productIMEI")
*/
private $tranfertCadeauxes;
public function __construct()
{
$this->stockUsers = new ArrayCollection();
$this->transfertPVs = new ArrayCollection();
$this->blIMEIs = new ArrayCollection();
$this->tranfertCadeauxes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getProduit(): ?Produit
{
return $this->produit;
}
public function setProduit(?Produit $produit): self
{
$this->produit = $produit;
return $this;
}
public function getImei(): ?string
{
return $this->imei;
}
public function setImei(string $imei): self
{
$this->imei = $imei;
return $this;
}
public function getDateEntree(): ?\DateTimeInterface
{
return $this->dateEntree;
}
public function setDateEntree(\DateTimeInterface $dateEntree): self
{
$this->dateEntree = $dateEntree;
return $this;
}
public function getDateSortie(): ?\DateTimeInterface
{
return $this->dateSortie;
}
public function setDateSortie(?\DateTimeInterface $dateSortie): self
{
$this->dateSortie = $dateSortie;
return $this;
}
public function getSiege(): ?Siege
{
return $this->siege;
}
public function setSiege(?Siege $siege): self
{
$this->siege = $siege;
return $this;
}
public function getDateTransfert(): ?\DateTimeInterface
{
return $this->dateTransfert;
}
public function setDateTransfert(?\DateTimeInterface $dateTransfert): self
{
$this->dateTransfert = $dateTransfert;
return $this;
}
public function getDateEntreeBoutique(): ?\DateTimeInterface
{
return $this->dateEntreeBoutique;
}
public function setDateEntreeBoutique(?\DateTimeInterface $dateEntreeBoutique): self
{
$this->dateEntreeBoutique = $dateEntreeBoutique;
return $this;
}
/**
* @return Collection<int, StockUser>
*/
public function getStockUsers(): Collection
{
return $this->stockUsers;
}
public function addStockUser(StockUser $stockUser): self
{
if (!$this->stockUsers->contains($stockUser)) {
$this->stockUsers[] = $stockUser;
$stockUser->setProduitIMEI($this);
}
return $this;
}
public function removeStockUser(StockUser $stockUser): self
{
if ($this->stockUsers->removeElement($stockUser)) {
// set the owning side to null (unless already changed)
if ($stockUser->getProduitIMEI() === $this) {
$stockUser->setProduitIMEI(null);
}
}
return $this;
}
/**
* @return Collection<int, TransfertPV>
*/
public function getTransfertPVs(): Collection
{
return $this->transfertPVs;
}
public function addTransfertPV(TransfertPV $transfertPV): self
{
if (!$this->transfertPVs->contains($transfertPV)) {
$this->transfertPVs[] = $transfertPV;
$transfertPV->setProduitIMEI($this);
}
return $this;
}
public function removeTransfertPV(TransfertPV $transfertPV): self
{
if ($this->transfertPVs->removeElement($transfertPV)) {
// set the owning side to null (unless already changed)
if ($transfertPV->getProduitIMEI() === $this) {
$transfertPV->setProduitIMEI(null);
}
}
return $this;
}
/**
* @return Collection<int, BlIMEI>
*/
public function getBlIMEIs(): Collection
{
return $this->blIMEIs;
}
public function addBlIMEI(BlIMEI $blIMEI): self
{
if (!$this->blIMEIs->contains($blIMEI)) {
$this->blIMEIs[] = $blIMEI;
$blIMEI->setProduitIMEI($this);
}
return $this;
}
public function removeBlIMEI(BlIMEI $blIMEI): self
{
if ($this->blIMEIs->removeElement($blIMEI)) {
// set the owning side to null (unless already changed)
if ($blIMEI->getProduitIMEI() === $this) {
$blIMEI->setProduitIMEI(null);
}
}
return $this;
}
/**
* @return Collection<int, TranfertCadeaux>
*/
public function getTranfertCadeauxes(): Collection
{
return $this->tranfertCadeauxes;
}
public function addTranfertCadeaux(TranfertCadeaux $tranfertCadeaux): self
{
if (!$this->tranfertCadeauxes->contains($tranfertCadeaux)) {
$this->tranfertCadeauxes[] = $tranfertCadeaux;
$tranfertCadeaux->setProductIMEI($this);
}
return $this;
}
public function removeTranfertCadeaux(TranfertCadeaux $tranfertCadeaux): self
{
if ($this->tranfertCadeauxes->removeElement($tranfertCadeaux)) {
// set the owning side to null (unless already changed)
if ($tranfertCadeaux->getProductIMEI() === $this) {
$tranfertCadeaux->setProductIMEI(null);
}
}
return $this;
}
}