<?php
namespace App\Entity\Package;
use App\Entity\Traits\AutoTranslateTrait;
use App\Entity\Traits\IdTrait;
use App\Entity\Traits\TimeStampAbleTrait;
use App\Repository\Package\PackageRepository;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\PersistentCollection;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
use App\Entity\Item\ItemCategory;
/**
* @ORM\Entity(repositoryClass=PackageRepository::class)
*/
class Package implements TranslatableInterface
{
use idTrait;
use TranslatableTrait;
use TimeStampAbleTrait;
use AutoTranslateTrait;
/**
* @ORM\ManyToMany(targetEntity=ItemCategory::class, inversedBy="packages")
* @ORM\JoinTable(name="package_industry")
*/
private $industry;
public function __construct(
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $active = false,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $visibleOnThePage = false,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $promotion = false,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $priceWithForks = 0.00,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $priceWithoutForks = 0.00,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $priceWithForksEn = 0.00,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $priceWithoutForksEn = 0.00,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $discount = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $discountPercentage = 0,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $discountPriceWithForks = 0.00,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $discountPriceWithoutForks = 0.00,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $discountPriceWithForksEn = 0.00,
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $discountPriceWithoutForksEn = 0.00,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $showIndustry = false,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $showPackageLength = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $packageLength = 0,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $showOfferLength = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $offerLength = 0,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $showNumberOfAds = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $numberOfAds = 0,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $showNumberOfRaises = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $numberOfRaises = 0,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $showNumberOfLocations = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $numberOfLocations = 0,
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?DateTime $activeUntil = null,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $isRange = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $numberOfActive = 0,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $isOwn = false,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $freePackage = false,
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $selectAllIndustry = false,
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $position = 0
){
$this->industry = new ArrayCollection();
}
public function getActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): self
{
$this->active = $active;
return $this;
}
public function getVisibleOnThePage(): ?bool
{
return $this->visibleOnThePage;
}
public function setVisibleOnThePage(?bool $visibleOnThePage): self
{
$this->visibleOnThePage = $visibleOnThePage;
return $this;
}
public function getPromotion(): ?bool
{
return $this->promotion;
}
public function setPromotion(?bool $promotion): self
{
$this->promotion = $promotion;
return $this;
}
public function getPriceWithForks(): ?float
{
return $this->priceWithForks;
}
public function setPriceWithForks(?float $priceWithForks): self
{
$this->priceWithForks = $priceWithForks;
return $this;
}
public function getPriceWithoutForks(): ?float
{
return $this->priceWithoutForks;
}
public function setPriceWithoutForks(?float $priceWithoutForks): self
{
$this->priceWithoutForks = $priceWithoutForks;
return $this;
}
public function getPriceWithForksEn(): ?float
{
return $this->priceWithForksEn;
}
public function setPriceWithForksEn(?float $priceWithForksEn): self
{
$this->priceWithForksEn = $priceWithForksEn;
return $this;
}
public function getPriceWithoutForksEn(): ?float
{
return $this->priceWithoutForksEn;
}
public function setPriceWithoutForksEn(?float $priceWithoutForksEn): self
{
$this->priceWithoutForksEn = $priceWithoutForksEn;
return $this;
}
public function getDiscount(): ?bool
{
return $this->discount;
}
public function setDiscount(?bool $discount): self
{
$this->discount = $discount;
return $this;
}
public function getDiscountPercentage(): ?int
{
return $this->discountPercentage;
}
public function setDiscountPercentage(?int $discountPercentage): self
{
$this->discountPercentage = $discountPercentage;
return $this;
}
public function getDiscountPriceWithForks(): ?float
{
return $this->discountPriceWithForks;
}
public function setDiscountPriceWithForks(?float $discountPriceWithForks): self
{
$this->discountPriceWithForks = $discountPriceWithForks;
return $this;
}
public function getDiscountPriceWithoutForks(): ?float
{
return $this->discountPriceWithoutForks;
}
public function setDiscountPriceWithoutForks(?float $discountPriceWithoutForks): self
{
$this->discountPriceWithoutForks = $discountPriceWithoutForks;
return $this;
}
public function getDiscountPriceWithForksEn(): ?float
{
return $this->discountPriceWithForksEn;
}
public function setDiscountPriceWithForksEn(?float $discountPriceWithForksEn): self
{
$this->discountPriceWithForksEn = $discountPriceWithForksEn;
return $this;
}
public function getDiscountPriceWithoutForksEn(): ?float
{
return $this->discountPriceWithoutForksEn;
}
public function setDiscountPriceWithoutForksEn(?float $discountPriceWithoutForksEn): self
{
$this->discountPriceWithoutForksEn = $discountPriceWithoutForksEn;
return $this;
}
public function getShowIndustry(): ?bool
{
return $this->showIndustry;
}
public function setShowIndustry(?bool $showIndustry): self
{
$this->showIndustry = $showIndustry;
return $this;
}
public function getShowPackageLength(): ?bool
{
return $this->showPackageLength;
}
public function setShowPackageLength(?bool $showPackageLength): self
{
$this->showPackageLength = $showPackageLength;
return $this;
}
public function getPackageLength(): ?int
{
return $this->packageLength;
}
public function setPackageLength(?int $packageLength): self
{
$this->packageLength = $packageLength;
return $this;
}
public function getShowOfferLength(): ?bool
{
return $this->showOfferLength;
}
public function setShowOfferLength(?bool $showOfferLength): self
{
$this->showOfferLength = $showOfferLength;
return $this;
}
public function getOfferLength(): ?int
{
return $this->offerLength;
}
public function setOfferLength(?int $offerLength): self
{
$this->offerLength = $offerLength;
return $this;
}
public function getShowNumberOfAds(): ?bool
{
return $this->showNumberOfAds;
}
public function setShowNumberOfAds(?bool $showNumberOfAds): self
{
$this->showNumberOfAds = $showNumberOfAds;
return $this;
}
public function getNumberOfAds(): ?int
{
return $this->numberOfAds;
}
public function setNumberOfAds(?int $numberOfAds): self
{
$this->numberOfAds = $numberOfAds;
return $this;
}
public function getShowNumberOfRaises(): ?bool
{
return $this->showNumberOfRaises;
}
public function setShowNumberOfRaises(?bool $showNumberOfRaises): self
{
$this->showNumberOfRaises = $showNumberOfRaises;
return $this;
}
public function getNumberOfRaises(): ?int
{
return $this->numberOfRaises;
}
public function setNumberOfRaises(?int $numberOfRaises): self
{
$this->numberOfRaises = $numberOfRaises;
return $this;
}
public function getShowNumberOfLocations(): ?bool
{
return $this->showNumberOfLocations;
}
public function setShowNumberOfLocations(?bool $showNumberOfLocations): self
{
$this->showNumberOfLocations = $showNumberOfLocations;
return $this;
}
public function getNumberOfLocations(): ?int
{
return $this->numberOfLocations;
}
public function setNumberOfLocations(?int $numberOfLocations): self
{
$this->numberOfLocations = $numberOfLocations;
return $this;
}
public function getActiveUntil(): ?DateTime
{
return $this->activeUntil;
}
public function setActiveUntil(?DateTime $activeUntil): self
{
$this->activeUntil = $activeUntil;
return $this;
}
public function getIsRange(): ?bool
{
return $this->isRange;
}
public function setIsRange(?bool $isRange): self
{
$this->isRange = $isRange;
return $this;
}
public function getIndustry(): PersistentCollection
{
return $this->industry;
}
public function addIndustry(?ItemCategory $itemCategory): self
{
if (!$this->industry->contains($itemCategory)) {
$this->industry[] = $itemCategory;
}
return $this;
}
public function removeIndustry(?ItemCategory $itemCategory): self
{
$this->industry->removeElement($itemCategory);
return $this;
}
public function getIndustriesIds(): array
{
$industriesIds = [];
foreach ($this->industry as $industry){
$industriesIds[] = $industry->getId();
}
return $industriesIds;
}
public function getNumberOfActive(): ?int
{
return $this->numberOfActive;
}
public function setNumberOfActive(?int $numberOfActive): self
{
$this->numberOfActive = $numberOfActive;
return $this;
}
public function getIsOwn(): ?bool
{
return $this->isOwn;
}
public function setIsOwn(?bool $isOwn): self
{
$this->isOwn = $isOwn;
return $this;
}
public function getFreePackage(): ?bool
{
return $this->freePackage;
}
public function setFreePackage(?bool $freePackage): self
{
$this->freePackage = $freePackage;
return $this;
}
public function getSelectAllIndustry(): ?bool
{
return $this->selectAllIndustry;
}
public function setSelectAllIndustry(?bool $selectAllIndustry): self
{
$this->selectAllIndustry = $selectAllIndustry;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setPosition(?int $position): self
{
$this->position = $position;
return $this;
}
}