src/Entity/Package/Package.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Package;
  3. use App\Entity\Traits\AutoTranslateTrait;
  4. use App\Entity\Traits\IdTrait;
  5. use App\Entity\Traits\TimeStampAbleTrait;
  6. use App\Repository\Package\PackageRepository;
  7. use DateTime;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Doctrine\ORM\PersistentCollection;
  11. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  12. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  13. use App\Entity\Item\ItemCategory;
  14. /**
  15.  * @ORM\Entity(repositoryClass=PackageRepository::class)
  16.  */
  17. class Package implements TranslatableInterface
  18. {
  19.   use idTrait;
  20.   use TranslatableTrait;
  21.   use TimeStampAbleTrait;
  22.   use AutoTranslateTrait;
  23.   /**
  24.    * @ORM\ManyToMany(targetEntity=ItemCategory::class, inversedBy="packages")
  25.    * @ORM\JoinTable(name="package_industry")
  26.    */
  27.   private $industry;
  28.   public function __construct(
  29.       /**
  30.        * @ORM\Column(type="boolean", nullable=true)
  31.        */
  32.       private ?bool $active = false,
  33.       /**
  34.        * @ORM\Column(type="boolean", nullable=true)
  35.        */
  36.       private ?bool $visibleOnThePage = false,
  37.       /**
  38.        * @ORM\Column(type="boolean", nullable=true)
  39.        */
  40.       private ?bool $promotion = false,
  41.       /**
  42.        * @ORM\Column(type="float", nullable=true)
  43.        */
  44.       private ?float $priceWithForks = 0.00,
  45.       /**
  46.        * @ORM\Column(type="float", nullable=true)
  47.        */
  48.       private ?float $priceWithoutForks = 0.00,
  49.       /**
  50.        * @ORM\Column(type="float", nullable=true)
  51.        */
  52.       private ?float $priceWithForksEn = 0.00,
  53.       /**
  54.        * @ORM\Column(type="float", nullable=true)
  55.        */
  56.       private ?float $priceWithoutForksEn = 0.00,
  57.       /**
  58.        * @ORM\Column(type="boolean", nullable=true)
  59.        */
  60.       private ?bool $discount = false,
  61.       /**
  62.        * @ORM\Column(type="integer", nullable=true)
  63.        */
  64.       private ?int $discountPercentage = 0,
  65.       /**
  66.        * @ORM\Column(type="float", nullable=true)
  67.        */
  68.       private ?float $discountPriceWithForks = 0.00,
  69.       /**
  70.        * @ORM\Column(type="float", nullable=true)
  71.        */
  72.       private ?float $discountPriceWithoutForks = 0.00,
  73.       /**
  74.        * @ORM\Column(type="float", nullable=true)
  75.        */
  76.       private ?float $discountPriceWithForksEn = 0.00,
  77.       /**
  78.        * @ORM\Column(type="float", nullable=true)
  79.        */
  80.       private ?float $discountPriceWithoutForksEn = 0.00,
  81.       /**
  82.        * @ORM\Column(type="boolean", nullable=true)
  83.        */
  84.       private ?bool $showIndustry = false,
  85.       /**
  86.        * @ORM\Column(type="boolean", nullable=true)
  87.        */
  88.       private ?bool $showPackageLength = false,
  89.       /**
  90.        * @ORM\Column(type="integer", nullable=true)
  91.        */
  92.       private ?int $packageLength = 0,
  93.       /**
  94.        * @ORM\Column(type="boolean", nullable=true)
  95.        */
  96.       private ?bool $showOfferLength = false,
  97.       /**
  98.        * @ORM\Column(type="integer", nullable=true)
  99.        */
  100.       private ?int $offerLength = 0,
  101.       /**
  102.        * @ORM\Column(type="boolean", nullable=true)
  103.        */
  104.       private ?bool $showNumberOfAds = false,
  105.       /**
  106.        * @ORM\Column(type="integer", nullable=true)
  107.        */
  108.       private ?int $numberOfAds = 0,
  109.       /**
  110.        * @ORM\Column(type="boolean", nullable=true)
  111.        */
  112.       private ?bool $showNumberOfRaises = false,
  113.       /**
  114.        * @ORM\Column(type="integer", nullable=true)
  115.        */
  116.       private ?int $numberOfRaises = 0,
  117.       /**
  118.        * @ORM\Column(type="boolean", nullable=true)
  119.        */
  120.       private ?bool $showNumberOfLocations = false,
  121.       /**
  122.        * @ORM\Column(type="integer", nullable=true)
  123.        */
  124.       private ?int $numberOfLocations = 0,
  125.       /**
  126.        * @ORM\Column(type="datetime", nullable=true)
  127.        */
  128.       private ?DateTime $activeUntil = null,
  129.       /**
  130.        * @ORM\Column(type="boolean", nullable=true)
  131.        */
  132.       private ?bool $isRange = false,
  133.       /**
  134.        * @ORM\Column(type="integer", nullable=true)
  135.        */
  136.       private ?int $numberOfActive = 0,
  137.       /**
  138.        * @ORM\Column(type="boolean", nullable=true)
  139.        */
  140.       private ?bool $isOwn = false,
  141.       /**
  142.        * @ORM\Column(type="boolean", nullable=true)
  143.        */
  144.       private ?bool $freePackage = false,
  145.       /**
  146.        * @ORM\Column(type="boolean", nullable=true)
  147.        */
  148.       private ?bool $selectAllIndustry = false,
  149.       /**
  150.        * @ORM\Column(type="integer", nullable=true)
  151.        */
  152.       private ?int $position = 0
  153.   ){
  154.       $this->industry = new ArrayCollection();
  155.   }
  156.     public function getActive(): ?bool
  157.     {
  158.         return $this->active;
  159.     }
  160.     public function setActive(?bool $active): self
  161.     {
  162.         $this->active = $active;
  163.         return $this;
  164.     }
  165.     public function getVisibleOnThePage(): ?bool
  166.     {
  167.         return $this->visibleOnThePage;
  168.     }
  169.     public function setVisibleOnThePage(?bool $visibleOnThePage): self
  170.     {
  171.         $this->visibleOnThePage = $visibleOnThePage;
  172.         return $this;
  173.     }
  174.     public function getPromotion(): ?bool
  175.     {
  176.         return $this->promotion;
  177.     }
  178.     public function setPromotion(?bool $promotion): self
  179.     {
  180.         $this->promotion = $promotion;
  181.         return $this;
  182.     }
  183.     public function getPriceWithForks(): ?float
  184.     {
  185.         return $this->priceWithForks;
  186.     }
  187.     public function setPriceWithForks(?float $priceWithForks): self
  188.     {
  189.         $this->priceWithForks = $priceWithForks;
  190.         return $this;
  191.     }
  192.     public function getPriceWithoutForks(): ?float
  193.     {
  194.         return $this->priceWithoutForks;
  195.     }
  196.     public function setPriceWithoutForks(?float $priceWithoutForks): self
  197.     {
  198.         $this->priceWithoutForks = $priceWithoutForks;
  199.         return $this;
  200.     }
  201.     public function getPriceWithForksEn(): ?float
  202.     {
  203.         return $this->priceWithForksEn;
  204.     }
  205.     public function setPriceWithForksEn(?float $priceWithForksEn): self
  206.     {
  207.         $this->priceWithForksEn = $priceWithForksEn;
  208.         return $this;
  209.     }
  210.     public function getPriceWithoutForksEn(): ?float
  211.     {
  212.         return $this->priceWithoutForksEn;
  213.     }
  214.     public function setPriceWithoutForksEn(?float $priceWithoutForksEn): self
  215.     {
  216.         $this->priceWithoutForksEn = $priceWithoutForksEn;
  217.         return $this;
  218.     }
  219.     public function getDiscount(): ?bool
  220.     {
  221.         return $this->discount;
  222.     }
  223.     public function setDiscount(?bool $discount): self
  224.     {
  225.         $this->discount = $discount;
  226.         return $this;
  227.     }
  228.     public function getDiscountPercentage(): ?int
  229.     {
  230.         return $this->discountPercentage;
  231.     }
  232.     public function setDiscountPercentage(?int $discountPercentage): self
  233.     {
  234.         $this->discountPercentage = $discountPercentage;
  235.         return $this;
  236.     }
  237.     public function getDiscountPriceWithForks(): ?float
  238.     {
  239.         return $this->discountPriceWithForks;
  240.     }
  241.     public function setDiscountPriceWithForks(?float $discountPriceWithForks): self
  242.     {
  243.         $this->discountPriceWithForks = $discountPriceWithForks;
  244.         return $this;
  245.     }
  246.     public function getDiscountPriceWithoutForks(): ?float
  247.     {
  248.         return $this->discountPriceWithoutForks;
  249.     }
  250.     public function setDiscountPriceWithoutForks(?float $discountPriceWithoutForks): self
  251.     {
  252.         $this->discountPriceWithoutForks = $discountPriceWithoutForks;
  253.         return $this;
  254.     }
  255.     public function getDiscountPriceWithForksEn(): ?float
  256.     {
  257.         return $this->discountPriceWithForksEn;
  258.     }
  259.     public function setDiscountPriceWithForksEn(?float $discountPriceWithForksEn): self
  260.     {
  261.         $this->discountPriceWithForksEn = $discountPriceWithForksEn;
  262.         return $this;
  263.     }
  264.     public function getDiscountPriceWithoutForksEn(): ?float
  265.     {
  266.         return $this->discountPriceWithoutForksEn;
  267.     }
  268.     public function setDiscountPriceWithoutForksEn(?float $discountPriceWithoutForksEn): self
  269.     {
  270.         $this->discountPriceWithoutForksEn = $discountPriceWithoutForksEn;
  271.         return $this;
  272.     }
  273.     public function getShowIndustry(): ?bool
  274.     {
  275.         return $this->showIndustry;
  276.     }
  277.     public function setShowIndustry(?bool $showIndustry): self
  278.     {
  279.         $this->showIndustry = $showIndustry;
  280.         return $this;
  281.     }
  282.     public function getShowPackageLength(): ?bool
  283.     {
  284.         return $this->showPackageLength;
  285.     }
  286.     public function setShowPackageLength(?bool $showPackageLength): self
  287.     {
  288.         $this->showPackageLength = $showPackageLength;
  289.         return $this;
  290.     }
  291.     public function getPackageLength(): ?int
  292.     {
  293.         return $this->packageLength;
  294.     }
  295.     public function setPackageLength(?int $packageLength): self
  296.     {
  297.         $this->packageLength = $packageLength;
  298.         return $this;
  299.     }
  300.     public function getShowOfferLength(): ?bool
  301.     {
  302.         return $this->showOfferLength;
  303.     }
  304.     public function setShowOfferLength(?bool $showOfferLength): self
  305.     {
  306.         $this->showOfferLength = $showOfferLength;
  307.         return $this;
  308.     }
  309.     public function getOfferLength(): ?int
  310.     {
  311.         return $this->offerLength;
  312.     }
  313.     public function setOfferLength(?int $offerLength): self
  314.     {
  315.         $this->offerLength = $offerLength;
  316.         return $this;
  317.     }
  318.     public function getShowNumberOfAds(): ?bool
  319.     {
  320.         return $this->showNumberOfAds;
  321.     }
  322.     public function setShowNumberOfAds(?bool $showNumberOfAds): self
  323.     {
  324.         $this->showNumberOfAds = $showNumberOfAds;
  325.         return $this;
  326.     }
  327.     public function getNumberOfAds(): ?int
  328.     {
  329.         return $this->numberOfAds;
  330.     }
  331.     public function setNumberOfAds(?int $numberOfAds): self
  332.     {
  333.         $this->numberOfAds = $numberOfAds;
  334.         return $this;
  335.     }
  336.     public function getShowNumberOfRaises(): ?bool
  337.     {
  338.         return $this->showNumberOfRaises;
  339.     }
  340.     public function setShowNumberOfRaises(?bool $showNumberOfRaises): self
  341.     {
  342.         $this->showNumberOfRaises = $showNumberOfRaises;
  343.         return $this;
  344.     }
  345.     public function getNumberOfRaises(): ?int
  346.     {
  347.         return $this->numberOfRaises;
  348.     }
  349.     public function setNumberOfRaises(?int $numberOfRaises): self
  350.     {
  351.         $this->numberOfRaises = $numberOfRaises;
  352.         return $this;
  353.     }
  354.     public function getShowNumberOfLocations(): ?bool
  355.     {
  356.         return $this->showNumberOfLocations;
  357.     }
  358.     public function setShowNumberOfLocations(?bool $showNumberOfLocations): self
  359.     {
  360.         $this->showNumberOfLocations = $showNumberOfLocations;
  361.         return $this;
  362.     }
  363.     public function getNumberOfLocations(): ?int
  364.     {
  365.         return $this->numberOfLocations;
  366.     }
  367.     public function setNumberOfLocations(?int $numberOfLocations): self
  368.     {
  369.         $this->numberOfLocations = $numberOfLocations;
  370.         return $this;
  371.     }
  372.     
  373.     public function getActiveUntil(): ?DateTime
  374.     {
  375.         return $this->activeUntil;
  376.     }
  377.     
  378.     public function setActiveUntil(?DateTime $activeUntil): self
  379.     {
  380.         $this->activeUntil = $activeUntil;
  381.         
  382.         return $this;
  383.     }
  384.     public function getIsRange(): ?bool
  385.     {
  386.         return $this->isRange;
  387.     }
  388.     public function setIsRange(?bool $isRange): self
  389.     {
  390.         $this->isRange = $isRange;
  391.         return $this;
  392.     }
  393.     public function getIndustry(): PersistentCollection
  394.     {
  395.         return $this->industry;
  396.     }
  397.     public function addIndustry(?ItemCategory $itemCategory): self
  398.     {
  399.         if (!$this->industry->contains($itemCategory)) {
  400.             $this->industry[] = $itemCategory;
  401.         }
  402.         return $this;
  403.     }
  404.     public function removeIndustry(?ItemCategory $itemCategory): self
  405.     {
  406.         $this->industry->removeElement($itemCategory);
  407.         return $this;
  408.     }
  409.     public function getIndustriesIds(): array
  410.     {
  411.         $industriesIds = [];
  412.         foreach ($this->industry as $industry){
  413.             $industriesIds[] = $industry->getId();
  414.         }
  415.         return $industriesIds;
  416.     }
  417.     public function getNumberOfActive(): ?int
  418.     {
  419.         return $this->numberOfActive;
  420.     }
  421.     public function setNumberOfActive(?int $numberOfActive): self
  422.     {
  423.         $this->numberOfActive = $numberOfActive;
  424.         return $this;
  425.     }
  426.     public function getIsOwn(): ?bool
  427.     {
  428.         return $this->isOwn;
  429.     }
  430.     public function setIsOwn(?bool $isOwn): self
  431.     {
  432.         $this->isOwn = $isOwn;
  433.         return $this;
  434.     }
  435.     public function getFreePackage(): ?bool
  436.     {
  437.         return $this->freePackage;
  438.     }
  439.     public function setFreePackage(?bool $freePackage): self
  440.     {
  441.         $this->freePackage = $freePackage;
  442.         return $this;
  443.     }
  444.     public function getSelectAllIndustry(): ?bool
  445.     {
  446.         return $this->selectAllIndustry;
  447.     }
  448.     public function setSelectAllIndustry(?bool $selectAllIndustry): self
  449.     {
  450.         $this->selectAllIndustry = $selectAllIndustry;
  451.         return $this;
  452.     }
  453.     public function getPosition(): ?int
  454.     {
  455.         return $this->position;
  456.     }
  457.     public function setPosition(?int $position): self
  458.     {
  459.         $this->position = $position;
  460.         return $this;
  461.     }
  462. }