<?php
namespace App\Entity;
use App\Repository\ProductRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ProductRepository::class)
*/
class Product
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cip7;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cip13;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $pricegrossiste;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $pricepharmacie;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $quantity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $collissage;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $quantitymin;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $amm;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cg;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $disponibilite;
/**
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="products")
*/
private $category;
/**
* @ORM\ManyToOne(targetEntity=Speciality::class, inversedBy="products")
*/
private $specialite;
/**
* @ORM\OneToMany(targetEntity=PropositionDetails::class, mappedBy="product")
*/
private $propositionDetails;
/**
* @ORM\OneToMany(targetEntity=OrderDetails::class, mappedBy="product_id")
*/
private $orderDetails;
/**
* @ORM\ManyToOne(targetEntity=ColisageType::class, inversedBy="products")
*/
private $colisageType;
/**
* @ORM\OneToMany(targetEntity=Cart::class, mappedBy="produit")
*/
private $carts;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pays;
/**
* @ORM\ManyToOne(targetEntity=DeclinaisonForm::class, inversedBy="products")
*/
private $declinaisonform;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $previsionarrivage;
/**
* @ORM\ManyToOne(targetEntity=Pays::class, inversedBy="products")
*/
private $payslocalisation;
/**
* @ORM\ManyToOne(targetEntity=Laboratoire::class, inversedBy="products")
*/
private $laboratoire;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $indication;
/**
* @ORM\OneToMany(targetEntity=ForecastDetails::class, mappedBy="produit_id")
*/
private $forecastDetails;
/**
* @ORM\OneToMany(targetEntity=Photo::class, mappedBy="produit")
*/
private $photos;
/**
* @ORM\OneToMany(targetEntity=Stockpharmacie::class, mappedBy="produit")
*/
private $stockpharmacies;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $posologie;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isStockPharmacie;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isOrdonnance;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isPhotoNotFound;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isDoublon;
/**
* @ORM\OneToMany(targetEntity=SearchHistory::class, mappedBy="clickAfter")
*/
private $searchHistories;
public function __construct()
{
$this->propositionDetails = new ArrayCollection();
$this->orderDetails = new ArrayCollection();
$this->carts = new ArrayCollection();
$this->forecastDetails = new ArrayCollection();
$this->photos = new ArrayCollection();
$this->stockpharmacies = new ArrayCollection();
$this->createdAt = new \DateTime();
$this->searchHistories = new ArrayCollection();
}
public function __toString()
{
return $this->getName();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCip7(): ?string
{
return $this->cip7;
}
public function setCip7(?string $cip7): self
{
$this->cip7 = $cip7;
return $this;
}
public function getCip13(): ?string
{
return $this->cip13;
}
public function setCip13(?string $cip13): self
{
$this->cip13 = $cip13;
return $this;
}
public function getPricegrossiste(): ?float
{
return $this->pricegrossiste;
}
public function setPricegrossiste(?float $pricegrossiste): self
{
$this->pricegrossiste = $pricegrossiste;
return $this;
}
public function getPricepharmacie(): ?float
{
return $this->pricepharmacie;
}
public function setPricepharmacie(?float $pricepharmacie): self
{
$this->pricepharmacie = $pricepharmacie;
return $this;
}
public function getQuantity(): ?int
{
return $this->quantity;
}
public function setQuantity(?int $quantity): self
{
$this->quantity = $quantity;
return $this;
}
public function getCollissage(): ?string
{
return $this->collissage;
}
public function setCollissage(?string $collissage): self
{
$this->collissage = $collissage;
return $this;
}
public function getQuantitymin(): ?int
{
return $this->quantitymin;
}
public function setQuantitymin(?int $quantitymin): self
{
$this->quantitymin = $quantitymin;
return $this;
}
public function getAmm(): ?string
{
return $this->amm;
}
public function setAmm(?string $amm): self
{
$this->amm = $amm;
return $this;
}
public function getCg(): ?string
{
return $this->cg;
}
public function setCg(?string $cg): self
{
$this->cg = $cg;
return $this;
}
public function getDisponibilite(): ?string
{
return $this->disponibilite;
}
public function setDisponibilite(?string $disponibilite): self
{
$this->disponibilite = $disponibilite;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
public function getSpecialite(): ?Speciality
{
return $this->specialite;
}
public function setSpecialite(?Speciality $specialite): self
{
$this->specialite = $specialite;
return $this;
}
/**
* @return Collection<int, PropositionDetails>
*/
public function getPropositionDetails(): Collection
{
return $this->propositionDetails;
}
public function addPropositionDetail(PropositionDetails $propositionDetail): self
{
if (!$this->propositionDetails->contains($propositionDetail)) {
$this->propositionDetails[] = $propositionDetail;
$propositionDetail->setProduct($this);
}
return $this;
}
public function removePropositionDetail(PropositionDetails $propositionDetail): self
{
if ($this->propositionDetails->removeElement($propositionDetail)) {
// set the owning side to null (unless already changed)
if ($propositionDetail->getProduct() === $this) {
$propositionDetail->setProduct(null);
}
}
return $this;
}
/**
* @return Collection<int, OrderDetails>
*/
public function getOrderDetails(): Collection
{
return $this->orderDetails;
}
public function addOrderDetail(OrderDetails $orderDetail): self
{
if (!$this->orderDetails->contains($orderDetail)) {
$this->orderDetails[] = $orderDetail;
$orderDetail->setProductId($this);
}
return $this;
}
public function removeOrderDetail(OrderDetails $orderDetail): self
{
if ($this->orderDetails->removeElement($orderDetail)) {
// set the owning side to null (unless already changed)
if ($orderDetail->getProductId() === $this) {
$orderDetail->setProductId(null);
}
}
return $this;
}
public function getColisageType(): ?ColisageType
{
return $this->colisageType;
}
public function setColisageType(?ColisageType $colisageType): self
{
$this->colisageType = $colisageType;
return $this;
}
/**
* @return Collection<int, Cart>
*/
public function getCarts(): Collection
{
return $this->carts;
}
public function addCart(Cart $cart): self
{
if (!$this->carts->contains($cart)) {
$this->carts[] = $cart;
$cart->setProduit($this);
}
return $this;
}
public function removeCart(Cart $cart): self
{
if ($this->carts->removeElement($cart)) {
// set the owning side to null (unless already changed)
if ($cart->getProduit() === $this) {
$cart->setProduit(null);
}
}
return $this;
}
public function getPays(): ?string
{
return $this->pays;
}
public function setPays(?string $pays): self
{
$this->pays = $pays;
return $this;
}
public function getDeclinaisonform(): ?DeclinaisonForm
{
return $this->declinaisonform;
}
public function setDeclinaisonform(?DeclinaisonForm $declinaisonform): self
{
$this->declinaisonform = $declinaisonform;
return $this;
}
public function getPrevisionarrivage(): ?int
{
return $this->previsionarrivage;
}
public function setPrevisionarrivage(?int $previsionarrivage): self
{
$this->previsionarrivage = $previsionarrivage;
return $this;
}
public function getPayslocalisation(): ?Pays
{
return $this->payslocalisation;
}
public function setPayslocalisation(?Pays $payslocalisation): self
{
$this->payslocalisation = $payslocalisation;
return $this;
}
public function getLaboratoire(): ?Laboratoire
{
return $this->laboratoire;
}
public function setLaboratoire(?Laboratoire $laboratoire): self
{
$this->laboratoire = $laboratoire;
return $this;
}
public function getIndication(): ?string
{
return $this->indication;
}
public function setIndication(?string $indication): self
{
$this->indication = $indication;
return $this;
}
/**
* @return Collection<int, ForecastDetails>
*/
public function getForecastDetails(): Collection
{
return $this->forecastDetails;
}
public function addForecastDetail(ForecastDetails $forecastDetail): self
{
if (!$this->forecastDetails->contains($forecastDetail)) {
$this->forecastDetails[] = $forecastDetail;
$forecastDetail->setProduitId($this);
}
return $this;
}
public function removeForecastDetail(ForecastDetails $forecastDetail): self
{
if ($this->forecastDetails->removeElement($forecastDetail)) {
// set the owning side to null (unless already changed)
if ($forecastDetail->getProduitId() === $this) {
$forecastDetail->setProduitId(null);
}
}
return $this;
}
/**
* @return Collection<int, Photo>
*/
public function getPhotos(): Collection
{
return $this->photos;
}
public function addPhoto(Photo $photo): self
{
if (!$this->photos->contains($photo)) {
$this->photos[] = $photo;
$photo->setProduit($this);
}
return $this;
}
public function removePhoto(Photo $photo): self
{
if ($this->photos->removeElement($photo)) {
// set the owning side to null (unless already changed)
if ($photo->getProduit() === $this) {
$photo->setProduit(null);
}
}
return $this;
}
/**
* @return Collection<int, Stockpharmacie>
*/
public function getStockpharmacies(): Collection
{
return $this->stockpharmacies;
}
public function addStockpharmacy(Stockpharmacie $stockpharmacy): self
{
if (!$this->stockpharmacies->contains($stockpharmacy)) {
$this->stockpharmacies[] = $stockpharmacy;
$stockpharmacy->setProduit($this);
}
return $this;
}
public function removeStockpharmacy(Stockpharmacie $stockpharmacy): self
{
if ($this->stockpharmacies->removeElement($stockpharmacy)) {
// set the owning side to null (unless already changed)
if ($stockpharmacy->getProduit() === $this) {
$stockpharmacy->setProduit(null);
}
}
return $this;
}
public function getPosologie(): ?string
{
return $this->posologie;
}
public function setPosologie(?string $posologie): self
{
$this->posologie = $posologie;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function isIsStockPharmacie(): ?bool
{
return $this->isStockPharmacie;
}
public function setIsStockPharmacie(?bool $isStockPharmacie): self
{
$this->isStockPharmacie = $isStockPharmacie;
return $this;
}
public function isIsOrdonnance(): ?bool
{
return $this->isOrdonnance;
}
public function setIsOrdonnance(?bool $isOrdonnance): self
{
$this->isOrdonnance = $isOrdonnance;
return $this;
}
public function isIsPhotoNotFound(): ?bool
{
return $this->isPhotoNotFound;
}
public function setIsPhotoNotFound(?bool $isPhotoNotFound): self
{
$this->isPhotoNotFound = $isPhotoNotFound;
return $this;
}
public function isIsDoublon(): ?bool
{
return $this->isDoublon;
}
public function setIsDoublon(?bool $isDoublon): self
{
$this->isDoublon = $isDoublon;
return $this;
}
/**
* @return Collection<int, SearchHistory>
*/
public function getSearchHistories(): Collection
{
return $this->searchHistories;
}
public function addSearchHistory(SearchHistory $searchHistory): self
{
if (!$this->searchHistories->contains($searchHistory)) {
$this->searchHistories[] = $searchHistory;
$searchHistory->setClickAfter($this);
}
return $this;
}
public function removeSearchHistory(SearchHistory $searchHistory): self
{
if ($this->searchHistories->removeElement($searchHistory)) {
// set the owning side to null (unless already changed)
if ($searchHistory->getClickAfter() === $this) {
$searchHistory->setClickAfter(null);
}
}
return $this;
}
}