<?php
namespace App\Entity;
use App\Repository\ArticlesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ArticlesRepository::class)
*/
class Articles
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $idPunch = null;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $empties = null;
/**
* @ORM\Column(type="float")
*/
private $stock = 0.0;
/**
* @ORM\Column(type="float")
*/
private $tax = 0.0;
/**
* @ORM\ManyToOne(targetEntity=Establishments::class, inversedBy="articles")
*/
private $supplier;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $barcode = null;
/**
* @ORM\Column(type="float")
*/
private $priceHtva = 0.0;
/**
* @ORM\Column(type="float")
*/
private $priceTvac = 0.0;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $intrastatCode = null;
/**
* @ORM\Column(type="float")
*/
private $weight = 0.0;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $codeTva = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $typeOfPackaging = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $accountingType = null;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $depositValue = null;
/**
* @ORM\Column(type="float")
*/
private $depositValueBottle = 0.0;
/**
* @ORM\ManyToOne(targetEntity=Units::class, inversedBy="articles")
*/
private $unit;
/**
* @ORM\OneToMany(targetEntity=ShoppingCart::class, mappedBy="article")
*/
private $shoppingCarts;
/**
* @ORM\OneToMany(targetEntity=OrderArticle::class, mappedBy="article")
*/
private $orderArticles;
/**
* @ORM\ManyToMany(targetEntity=DiscountGroups::class, inversedBy="articles")
*/
private $discountGroups;
/**
* @ORM\ManyToMany(targetEntity=ItemGroups::class, inversedBy="articles")
*/
private $itemGroups;
/**
* @ORM\ManyToMany(targetEntity=TagGroups::class, mappedBy="articles")
*/
private $tagGroups;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime")
*/
private $updatedAt;
/**
* @ORM\OneToMany(targetEntity=TarifsArticle::class, mappedBy="article")
*/
private $tarifsArticles;
/**
* @ORM\Column(type="boolean")
*/
private $deleted = false;
/**
* @ORM\Column(type="string", length=5000, nullable=true)
*/
private $pathImage = null;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $weightValue = null;
/**
* @ORM\Column(type="integer")
*/
private $maxQuantity = 0;
/**
* @ORM\Column(type="integer")
*/
private $minQuantity = 0;
/**
* @ORM\OneToMany(targetEntity=Favorite::class, mappedBy="Article")
*/
private $favorites;
/**
* @ORM\OneToMany(targetEntity=RestrictionArticle::class, mappedBy="article")
*/
private $restrictionArticles;
/**
* @ORM\Column(type="boolean")
*/
private $forMobileApp = 1;
/**
* @ORM\ManyToMany(targetEntity=ChildTags::class, mappedBy="articles")
*/
private $childTags;
/**
* @ORM\OneToMany(targetEntity=Banner::class, mappedBy="article")
*/
private $banners;
/**
* @ORM\OneToMany(targetEntity=Promotions::class, mappedBy="article")
*/
private $promotions;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $infoTextPunch;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $webshopPunch;
/**
* @ORM\OneToMany(targetEntity=RelationArticles::class, mappedBy="parentArticle")
*/
private $relationArticleParent;
/**
* @ORM\OneToMany(targetEntity=RelationArticles::class, mappedBy="childArticle")
*/
private $realtionArticleChild;
/**
* @ORM\OneToMany(targetEntity=ArticleOrderOutOfStock::class, mappedBy="article")
*/
private $articleOrderOutOfStocks;
/**
* @ORM\ManyToMany(targetEntity=FilterChild::class, mappedBy="article")
*/
private $filterChildren;
/**
* @ORM\Column(type="boolean")
*/
private $newArticle = 1;
/**
* @ORM\OneToMany(targetEntity=PromotionItem::class, mappedBy="article")
*/
private $promotionItems;
/**
* @ORM\OneToMany(targetEntity=NewArticle::class, mappedBy="article")
*/
private $newArticles;
/**
* @ORM\Column(type="integer")
*/
private $numberOfArticle = 1;
/**
* @ORM\Column(type="boolean")
*/
private $modifiedVisibility;
/**
* @ORM\OneToMany(targetEntity=BackOrder::class, mappedBy="article")
*/
private $backOrders;
/**
* @ORM\ManyToOne(targetEntity=Users::class, inversedBy="articles")
*/
private $visibleBy = null;
/**
* @ORM\Column(type="boolean")
*/
private $modifyQuantity = false;
public function __construct()
{
$this->updatedAt = New \DateTime();
$this->createdAt = New \DateTime();
$this->shoppingCarts = new ArrayCollection();
$this->orderArticles = new ArrayCollection();
$this->discountGroups = new ArrayCollection();
$this->itemGroups = new ArrayCollection();
$this->tagGroups = new ArrayCollection();
$this->tarifsArticles = new ArrayCollection();
$this->favorites = new ArrayCollection();
$this->restrictionArticles = new ArrayCollection();
$this->childTags = new ArrayCollection();
$this->banners = new ArrayCollection();
$this->promotions = new ArrayCollection();
$this->relationArticleParent = new ArrayCollection();
$this->realtionArticleChild = new ArrayCollection();
$this->articleOrderOutOfStocks = new ArrayCollection();
$this->filterChildren = new ArrayCollection();
$this->promotionItems = new ArrayCollection();
$this->newArticles = new ArrayCollection();
$this->backOrders = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIdPunch(): ?string
{
return $this->idPunch;
}
public function setIdPunch(?string $idPunch): self
{
$this->idPunch = $idPunch;
return $this;
}
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;
return $this->infoTextPunch;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getEmpties(): ?string
{
return $this->empties;
}
public function setEmpties(?string $empties): self
{
$this->empties = $empties;
return $this;
}
public function getStock(): ?float
{
return $this->stock;
}
public function setStock(float $stock): self
{
$this->stock = $stock;
return $this;
}
public function getTax(): ?float
{
return $this->tax;
}
public function setTax(float $tax): self
{
$this->tax = $tax;
return $this;
}
public function getSupplier(): ?Establishments
{
return $this->supplier;
}
public function setSupplier(?Establishments $supplier): self
{
$this->supplier = $supplier;
return $this;
}
public function getBarcode(): ?string
{
return $this->barcode;
}
public function setBarcode(?string $barcode): self
{
$this->barcode = $barcode;
return $this;
}
public function getPriceHtva(): ?float
{
return $this->priceHtva;
}
public function setPriceHtva(float $priceHtva): self
{
$this->priceHtva = $priceHtva;
return $this;
}
public function getPriceTvac(): ?float
{
return $this->priceTvac;
}
public function setPriceTvac(float $priceTvac): self
{
$this->priceTvac = $priceTvac;
return $this;
}
public function getIntrastatCode(): ?string
{
return $this->intrastatCode;
}
public function setIntrastatCode(?string $intrastatCode): self
{
$this->intrastatCode = $intrastatCode;
return $this;
}
public function getWeight(): ?float
{
return $this->weight;
}
public function setWeight(float $weight): self
{
$this->weight = $weight;
return $this;
}
public function getCodeTva(): ?string
{
return $this->codeTva;
}
public function setCodeTva(?string $codeTva): self
{
$this->codeTva = $codeTva;
return $this;
}
public function getTypeOfPackaging(): ?string
{
return $this->typeOfPackaging;
}
public function setTypeOfPackaging(?string $typeOfPackaging): self
{
$this->typeOfPackaging = $typeOfPackaging;
return $this;
}
public function getAccountingType(): ?string
{
return $this->accountingType;
}
public function setAccountingType(?string $accountingType): self
{
$this->accountingType = $accountingType;
return $this;
}
public function getDepositValue(): ?float
{
return $this->depositValue;
}
public function setDepositValue(?float $depositValue): self
{
$this->depositValue = $depositValue;
return $this;
}
public function getDepositValueBottle(): ?float
{
return $this->depositValueBottle;
}
public function setDepositValueBottle(float $depositValueBottle): self
{
$this->depositValueBottle = $depositValueBottle;
return $this;
}
public function getUnit(): ?Units
{
return $this->unit;
}
public function setUnit(?Units $unit): self
{
$this->unit = $unit;
return $this;
}
/**
* @return Collection<int, ShoppingCart>
*/
public function getShoppingCarts(): Collection
{
return $this->shoppingCarts;
}
public function addShoppingCart(ShoppingCart $shoppingCart): self
{
if (!$this->shoppingCarts->contains($shoppingCart)) {
$this->shoppingCarts[] = $shoppingCart;
$shoppingCart->setArticle($this);
}
return $this;
}
public function removeShoppingCart(ShoppingCart $shoppingCart): self
{
if ($this->shoppingCarts->removeElement($shoppingCart)) {
// set the owning side to null (unless already changed)
if ($shoppingCart->getArticle() === $this) {
$shoppingCart->setArticle(null);
}
}
return $this;
}
/**
* @return Collection<int, OrderArticle>
*/
public function getOrderArticles(): Collection
{
return $this->orderArticles;
}
public function addOrderArticle(OrderArticle $orderArticle): self
{
if (!$this->orderArticles->contains($orderArticle)) {
$this->orderArticles[] = $orderArticle;
$orderArticle->setArticle($this);
}
return $this;
}
public function removeOrderArticle(OrderArticle $orderArticle): self
{
if ($this->orderArticles->removeElement($orderArticle)) {
// set the owning side to null (unless already changed)
if ($orderArticle->getArticle() === $this) {
$orderArticle->setArticle(null);
}
}
return $this;
}
/**
* @return Collection<int, DiscountGroups>
*/
public function getDiscountGroups(): Collection
{
return $this->discountGroups;
}
public function addDiscountGroup(DiscountGroups $discountGroup): self
{
if (!$this->discountGroups->contains($discountGroup)) {
$this->discountGroups[] = $discountGroup;
}
return $this;
}
public function removeDiscountGroup(DiscountGroups $discountGroup): self
{
$this->discountGroups->removeElement($discountGroup);
return $this;
}
/**
* @return Collection<int, ItemGroups>
*/
public function getItemGroups(): Collection
{
return $this->itemGroups;
}
public function addItemGroup(ItemGroups $itemGroup): self
{
if (!$this->itemGroups->contains($itemGroup)) {
$this->itemGroups[] = $itemGroup;
}
return $this;
}
public function removeItemGroup(ItemGroups $itemGroup): self
{
$this->itemGroups->removeElement($itemGroup);
return $this;
}
/**
* @return Collection<int, TagGroups>
*/
public function getTagGroups(): Collection
{
return $this->tagGroups;
}
public function addTagGroup(TagGroups $tagGroup): self
{
if (!$this->tagGroups->contains($tagGroup)) {
$this->tagGroups[] = $tagGroup;
$tagGroup->addArticle($this);
}
return $this;
}
public function removeTagGroup(TagGroups $tagGroup): self
{
if ($this->tagGroups->removeElement($tagGroup)) {
$tagGroup->removeArticle($this);
}
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return Collection<int, TarifsArticle>
*/
public function getTarifsArticles(): Collection
{
return $this->tarifsArticles;
}
public function addTarifsArticle(TarifsArticle $tarifsArticle): self
{
if (!$this->tarifsArticles->contains($tarifsArticle)) {
$this->tarifsArticles[] = $tarifsArticle;
$tarifsArticle->setArticle($this);
}
return $this;
}
public function removeTarifsArticle(TarifsArticle $tarifsArticle): self
{
if ($this->tarifsArticles->removeElement($tarifsArticle)) {
// set the owning side to null (unless already changed)
if ($tarifsArticle->getArticle() === $this) {
$tarifsArticle->setArticle(null);
}
}
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
public function getPathImage(): ?string
{
return $this->pathImage;
}
public function setPathImage(?string $pathImage): self
{
$this->pathImage = $pathImage;
return $this;
}
public function getWeightValue(): ?float
{
return $this->weightValue;
}
public function setWeightValue(?float $weightValue): self
{
$this->weightValue = $weightValue;
return $this;
}
/**
* @return Collection<int, Favorite>
*/
public function getFavorites(): Collection
{
return $this->favorites;
}
public function addFavorite(Favorite $favorite): self
{
if (!$this->favorites->contains($favorite)) {
$this->favorites[] = $favorite;
$favorite->setArticle($this);
}
return $this;
}
public function getMaxQuantity(): ?int
{
return $this->maxQuantity;
}
public function setMaxQuantity(int $maxQuantity): self
{
$this->maxQuantity = $maxQuantity;
return $this;
}
public function getminQuantity(): ?int
{
return $this->minQuantity;
}
public function setminQuantity(int $minQuantity): self
{
$this->minQuantity = $minQuantity;
return $this;
}
public function removeFavorite(Favorite $favorite): self
{
if ($this->favorites->removeElement($favorite)) {
// set the owning side to null (unless already changed)
if ($favorite->getArticle() === $this) {
$favorite->setArticle(null);
}
}
return $this;
}
/**
* @return Collection<int, RestrictionArticle>
*/
public function getRestrictionArticles(): Collection
{
return $this->restrictionArticles;
}
public function addRestrictionArticle(RestrictionArticle $restrictionArticle): self
{
if (!$this->restrictionArticles->contains($restrictionArticle)) {
$this->restrictionArticles[] = $restrictionArticle;
$restrictionArticle->setArticle($this);
}
return $this;
}
public function removeRestrictionArticle(RestrictionArticle $restrictionArticle): self
{
if ($this->restrictionArticles->removeElement($restrictionArticle)) {
// set the owning side to null (unless already changed)
if ($restrictionArticle->getArticle() === $this) {
$restrictionArticle->setArticle(null);
}
}
return $this;
}
public function isForMobileApp(): ?bool
{
return $this->forMobileApp;
}
public function setForMobileApp(bool $forMobileApp): self
{
$this->forMobileApp = $forMobileApp;
return $this;
}
/**
* @return Collection<int, ChildTags>
*/
public function getChildTags(): Collection
{
return $this->childTags;
}
public function addChildTag(ChildTags $childTag): self
{
if (!$this->childTags->contains($childTag)) {
$this->childTags[] = $childTag;
$childTag->addArticle($this);
}
return $this;
}
public function removeChildTag(ChildTags $childTag): self
{
if ($this->childTags->removeElement($childTag)) {
$childTag->removeArticle($this);
}
return $this;
}
/**
* @return Collection<int, Banner>
*/
public function getBanners(): Collection
{
return $this->banners;
}
public function addBanner(Banner $banner): self
{
if (!$this->banners->contains($banner)) {
$this->banners[] = $banner;
$banner->setArticle($this);
}
return $this;
}
public function removeBanner(Banner $banner): self
{
if ($this->banners->removeElement($banner)) {
// set the owning side to null (unless already changed)
if ($banner->getArticle() === $this) {
$banner->setArticle(null);
}
}
return $this;
}
/**
* @return Collection<int, Promotions>
*/
public function getPromotions(): Collection
{
return $this->promotions;
}
public function addPromotion(Promotions $promotion): self
{
if (!$this->promotions->contains($promotion)) {
$this->promotions[] = $promotion;
$promotion->setArticle($this);
}
return $this;
}
public function removePromotion(Promotions $promotion): self
{
if ($this->promotions->removeElement($promotion)) {
// set the owning side to null (unless already changed)
if ($promotion->getArticle() === $this) {
$promotion->setArticle(null);
}
}
return $this;
}
public function getInfoTextPunch(): ?string
{
return $this->infoTextPunch;
}
public function setInfoTextPunch(?string $infoTextPunch): self
{
$this->infoTextPunch = $infoTextPunch;
return $this;
}
public function getWebshopPunch(): ?string
{
return $this->webshopPunch;
}
public function setWebshopPunch(?string $webshopPunch): self
{
$this->webshopPunch = $webshopPunch;
return $this;
}
/**
* @return Collection<int, RelationArticles>
*/
public function getRelationArticleParent(): Collection
{
return $this->relationArticleParent;
}
public function addRelationArticleParent(RelationArticles $relationArticleParent): self
{
if (!$this->relationArticleParent->contains($relationArticleParent)) {
$this->relationArticleParent[] = $relationArticleParent;
$relationArticleParent->setParentArticle($this);
}
return $this;
}
public function removeRelationArticleParent(RelationArticles $relationArticleParent): self
{
if ($this->relationArticleParent->removeElement($relationArticleParent)) {
// set the owning side to null (unless already changed)
if ($relationArticleParent->getParentArticle() === $this) {
$relationArticleParent->setParentArticle(null);
}
}
return $this;
}
/**
* @return Collection<int, RelationArticles>
*/
public function getRealtionArticleChild(): Collection
{
return $this->realtionArticleChild;
}
public function addRealtionArticleChild(RelationArticles $realtionArticleChild): self
{
if (!$this->realtionArticleChild->contains($realtionArticleChild)) {
$this->realtionArticleChild[] = $realtionArticleChild;
$realtionArticleChild->setChildArticle($this);
}
return $this;
}
public function removeRealtionArticleChild(RelationArticles $realtionArticleChild): self
{
if ($this->realtionArticleChild->removeElement($realtionArticleChild)) {
// set the owning side to null (unless already changed)
if ($realtionArticleChild->getChildArticle() === $this) {
$realtionArticleChild->setChildArticle(null);
}
}
return $this;
}
/**
* @return Collection<int, ArticleOrderOutOfStock>
*/
public function getArticleOrderOutOfStocks(): Collection
{
return $this->articleOrderOutOfStocks;
}
public function addArticleOrderOutOfStock(ArticleOrderOutOfStock $articleOrderOutOfStock): self
{
if (!$this->articleOrderOutOfStocks->contains($articleOrderOutOfStock)) {
$this->articleOrderOutOfStocks[] = $articleOrderOutOfStock;
$articleOrderOutOfStock->setArticle($this);
}
return $this;
}
public function removeArticleOrderOutOfStock(ArticleOrderOutOfStock $articleOrderOutOfStock): self
{
if ($this->articleOrderOutOfStocks->removeElement($articleOrderOutOfStock)) {
// set the owning side to null (unless already changed)
if ($articleOrderOutOfStock->getArticle() === $this) {
$articleOrderOutOfStock->setArticle(null);
}
}
return $this;
}
/**
* @return Collection<int, FilterChild>
*/
public function getFilterChildren(): Collection
{
return $this->filterChildren;
}
public function addFilterChild(FilterChild $filterChild): self
{
if (!$this->filterChildren->contains($filterChild)) {
$this->filterChildren[] = $filterChild;
$filterChild->addArticle($this);
}
return $this;
}
public function removeFilterChild(FilterChild $filterChild): self
{
if ($this->filterChildren->removeElement($filterChild)) {
$filterChild->removeArticle($this);
}
return $this;
}
public function isNewArticle(): ?bool
{
return $this->newArticle;
}
public function setNewArticle(bool $newArticle): self
{
$this->newArticle = $newArticle;
return $this;
}
public function getNumberOfArticle(): ?int
{
return $this->numberOfArticle;
}
public function setNumberOfArticle(int $numberOfArticle): self
{
$this->numberOfArticle = $numberOfArticle;
return $this;
}
/**
* @return Collection<int, PromotionItem>
*/
public function getPromotionItems(): Collection
{
return $this->promotionItems;
}
public function addPromotionItem(PromotionItem $promotionItem): self
{
if (!$this->promotionItems->contains($promotionItem)) {
$this->promotionItems[] = $promotionItem;
$promotionItem->setArticle($this);
}
return $this;
}
/**
* @return Collection<int, NewArticle>
*/
public function getNewArticles(): Collection
{
return $this->newArticles;
}
public function addNewArticle(NewArticle $newArticle): self
{
if (!$this->newArticles->contains($newArticle)) {
$this->newArticles[] = $newArticle;
$newArticle->setArticle($this);
}
return $this;
}
public function removePromotionItem(PromotionItem $promotionItem): self
{
if ($this->promotionItems->removeElement($promotionItem)) {
// set the owning side to null (unless already changed)
if ($promotionItem->getArticle() === $this) {
$promotionItem->setArticle(null);
}
}
return $this;
}
public function removeNewArticle(NewArticle $newArticle): self
{
if ($this->newArticles->removeElement($newArticle)) {
// set the owning side to null (unless already changed)
if ($newArticle->getArticle() === $this) {
$newArticle->setArticle(null);
}
}
return $this;
}
public function isModifiedVisibility(): ?bool
{
return $this->modifiedVisibility;
}
public function setModifiedVisibility(bool $modifiedVisibility): self
{
$this->modifiedVisibility = $modifiedVisibility;
return $this;
}
/**
* @return Collection<int, BackOrder>
*/
public function getBackOrders(): Collection
{
return $this->backOrders;
}
public function addBackOrder(BackOrder $backOrder): self
{
if (!$this->backOrders->contains($backOrder)) {
$this->backOrders[] = $backOrder;
$backOrder->setArticle($this);
}
return $this;
}
public function removeBackOrder(BackOrder $backOrder): self
{
if ($this->backOrders->removeElement($backOrder)) {
// set the owning side to null (unless already changed)
if ($backOrder->getArticle() === $this) {
$backOrder->setArticle(null);
}
}
return $this;
}
public function getVisibleBy(): ?Users
{
return $this->visibleBy;
}
public function setVisibleBy(?Users $visibleBy): self
{
$this->visibleBy = $visibleBy;
return $this;
}
public function isModifyQuantity(): ?bool
{
return $this->modifyQuantity;
}
public function setModifyQuantity(bool $modifyQuantity): self
{
$this->modifyQuantity = $modifyQuantity;
return $this;
}
}