<?php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping\Index;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\ProdRepository;
use App\Entity\Translation\ProdTranslation;
use App\Env;
use Gedmo\Mapping\Annotation\TranslationEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
#[ORM\Entity(repositoryClass: ProdRepository::class)]
#[TranslationEntity(class: ProdTranslation::class)]
#[Index(name: "prod_cat", columns: ["cat"])]
#[Index(name: "prod_art", columns: ["art"])]
#[Index(name: "prod_prior", columns: ["prior"])]
#[Index(name: "prod_pop", columns: ["pop", "visible"])]
#[Index(name: "prod_action", columns: ["action", "visible"])]
#[Index(name: "prod_mix", columns: ["mix", "visible"])]
#[Index(name: "prod_new", columns: ["new", "visible"])]
#[Index(name: "prod_sale", columns: ["sale", "visible"])]
#[Index(name: "prod_tags", columns: ["tags"])]
class Prod implements EntityInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'integer')]
private int $cat = 0;
#[ORM\Column(length: 255)]
private ?string $intname = null;
#[GedmoTranslatable]
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $art = null;
#[GedmoTranslatable]
#[ORM\Column(type: Types::TEXT)]
private ?string $short = null;
#[GedmoTranslatable]
#[ORM\Column(type: Types::TEXT)]
private ?string $cont = null;
#[ORM\Column]
private ?float $price = null;
#[ORM\Column]
private ?float $price2 = null;
#[ORM\Column]
private ?float $price3 = null;
#[ORM\Column]
private ?float $price4 = null;
#[ORM\Column]
private ?float $priceopt = null;
#[ORM\Column]
private ?float $priceopt2 = null;
#[ORM\Column]
private ?float $priceopt3 = null;
#[ORM\Column]
private ?float $priceopt4 = null;
#[ORM\Column]
private ?float $skidka = null;
#[ORM\Column]
private ?float $skidka2 = null;
#[ORM\Column]
private ?float $skidka3 = null;
#[ORM\Column]
private ?float $skidka4 = null;
#[ORM\Column]
private ?float $skidkaopt = null;
#[ORM\Column]
private ?float $skidkaopt2 = null;
#[ORM\Column]
private ?float $skidkaopt3 = null;
#[ORM\Column]
private ?float $skidkaopt4 = null;
#[ORM\Column]
private array $numdiscount = [];
#[ORM\Column]
private array $numdiscount2 = [];
#[ORM\Column]
private array $numdiscount3 = [];
#[ORM\Column]
private array $numdiscount4 = [];
#[ORM\Column]
private array $numdiscountopt = [];
#[ORM\Column]
private array $numdiscountopt2 = [];
#[ORM\Column]
private array $numdiscountopt3 = [];
#[ORM\Column]
private array $numdiscountopt4 = [];
#[ORM\Column]
private ?int $num = null;
#[ORM\Column]
private ?int $num2 = null;
#[ORM\Column]
private ?int $num3 = null;
#[ORM\Column]
private ?int $num4 = null;
#[ORM\Column(length: 255)]
#[GedmoTranslatable]
private ?string $inpack = null;
#[ORM\Column(length: 255)]
#[GedmoTranslatable]
private ?string $inpack2 = null;
#[ORM\Column(length: 255)]
#[GedmoTranslatable]
private ?string $inpack3 = null;
#[ORM\Column(length: 255)]
#[GedmoTranslatable]
private ?string $inpack4 = null;
#[ORM\Column]
private ?int $weight = null;
#[ORM\Column]
private ?int $weight2 = null;
#[ORM\Column]
private ?int $weight3 = null;
#[ORM\Column]
private ?int $weight4 = null;
#[ORM\Column]
private ?bool $visible = null;
#[ORM\Column]
private ?bool $pop = null;
#[ORM\Column]
private ?bool $action = null;
#[ORM\Column]
private ?bool $mix = null;
#[ORM\Column]
private ?bool $main = null;
#[ORM\Column]
private ?bool $new = null;
#[ORM\Column]
private ?bool $sale = null;
#[ORM\Column]
private ?bool $onsale = null;
#[ORM\Column]
private ?int $prior = null;
#[GedmoTranslatable]
#[ORM\Column(length: 1000)]
private ?string $title = null;
#[GedmoTranslatable]
#[ORM\Column(length: 1000)]
private ?string $descr = null;
#[GedmoTranslatable]
#[ORM\Column(length: 1000)]
private ?string $kw = null;
#[GedmoTranslatable]
#[ORM\Column(length: 1000)]
private ?string $h1 = null;
#[ORM\Column]
private ?int $rating = null;
#[ORM\Column(length: 255)]
private ?string $spec = null;
#[ORM\Column]
private ?int $ordered = null;
#[ORM\Column(length: 255)]
private ?string $izm = null;
#[ORM\Column(length: 255)]
private ?string $pic = null;
#[ORM\Column]
private ?int $views = null;
#[ORM\Column]
private ?bool $justuploaded = null;
#[ORM\Column]
private ?int $uploaded = null;
#[ORM\Column]
private ?int $changed = null;
#[ORM\Column]
private array $colors = [];
#[ORM\Column(length: 255)]
private ?string $sku = null;
#[ORM\Column(length: 255)]
private ?string $model = null;
#[ORM\Column(length: 1000)]
private ?string $chars = null;
#[ORM\Column(length: 1000)]
private ?string $tags = null;
public $prices = [];
public $photos = [];
public $childs = [];
#[GedmoLocale]
private $locale;
#[ORM\OneToMany(targetEntity: ProdTranslation::class, mappedBy: 'object', cascade: ['persist', 'remove'])]
private $translations;
#[ORM\Column(length: 255, nullable: true)]
private ?string $externalId = null;
public function __construct()
{
$this->translations = new ArrayCollection();
}
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getTranslations()
{
return $this->translations;
}
public function addTranslation(ProdTranslation $t)
{
if (!$this->translations->contains($t)) {
$this->translations[] = $t;
$t->setObject($this);
}
}
public function getId(): ?int
{
return $this->id;
}
public function getCat(): int
{
return $this->cat;
}
public function setCat(int $cat): self
{
$this->cat = $cat;
return $this;
}
public function getIntname(): ?string
{
return $this->intname;
}
public function setIntname(string $intname): self
{
$this->intname = $intname;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getArt(): ?string
{
return $this->art;
}
public function setArt(string $art): self
{
$this->art = $art;
return $this;
}
public function getShort(): ?string
{
return $this->short;
}
public function setShort(string $short): self
{
$this->short = $short;
return $this;
}
public function getCont(): ?string
{
return str_replace(["|"], ["<br>"], $this->cont);
}
public function setCont(string $cont): self
{
$this->cont = $cont;
return $this;
}
public function setPrices(array $prices)
{
$this->prices = $prices;
}
public function getPrices(): array
{
return $this->prices;
}
public function getPrice(): ?float
{
return Env::is_opt() ? $this->priceopt : $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
public function getPrice2(): ?float
{
return Env::is_opt() ? $this->priceopt2 : $this->price2;
}
public function setPrice2(float $price2): self
{
$this->price2 = $price2;
return $this;
}
public function getPrice3(): ?float
{
return Env::is_opt() ? $this->priceopt3 : $this->price3;
}
public function setPrice3(float $price3): self
{
$this->price3 = $price3;
return $this;
}
public function getPrice4(): ?float
{
return Env::is_opt() ? $this->priceopt4 : $this->price4;
}
public function setPrice4(float $price4): self
{
$this->price4 = $price4;
return $this;
}
public function getPriceopt(): ?float
{
return $this->priceopt;
}
public function setPriceopt(float $priceopt): self
{
$this->priceopt = $priceopt;
return $this;
}
public function getPriceopt2(): ?float
{
return $this->priceopt2;
}
public function setPriceopt2(float $priceopt2): self
{
$this->priceopt2 = $priceopt2;
return $this;
}
public function getPriceopt3(): ?float
{
return $this->priceopt3;
}
public function setPriceopt3(float $priceopt3): self
{
$this->priceopt3 = $priceopt3;
return $this;
}
public function getPriceopt4(): ?float
{
return $this->priceopt4;
}
public function setPriceopt4(float $priceopt4): self
{
$this->priceopt4 = $priceopt4;
return $this;
}
public function getSkidka(): ?float
{
return Env::is_opt() ? $this->skidkaopt : $this->skidka;
}
public function setSkidka(float $skidka): self
{
$this->skidka = $skidka;
return $this;
}
public function getSkidka2(): ?float
{
return Env::is_opt() ? $this->skidkaopt2 : $this->skidka2;
}
public function setSkidka2(float $skidka2): self
{
$this->skidka2 = $skidka2;
return $this;
}
public function getSkidka3(): ?float
{
return Env::is_opt() ? $this->skidkaopt3 : $this->skidka3;
}
public function setSkidka3(float $skidka3): self
{
$this->skidka3 = $skidka3;
return $this;
}
public function getSkidka4(): ?float
{
return Env::is_opt() ? $this->skidkaopt4 : $this->skidka4;
}
public function setSkidka4(float $skidka4): self
{
$this->skidka4 = $skidka4;
return $this;
}
public function getSkidkaopt(): ?float
{
return $this->skidkaopt;
}
public function setSkidkaopt(float $skidkaopt): self
{
$this->skidkaopt = $skidkaopt;
return $this;
}
public function getSkidkaopt2(): ?float
{
return $this->skidkaopt2;
}
public function setSkidkaopt2(float $skidkaopt2): self
{
$this->skidkaopt2 = $skidkaopt2;
return $this;
}
public function getSkidkaopt3(): ?float
{
return $this->skidkaopt3;
}
public function setSkidkaopt3(float $skidkaopt3): self
{
$this->skidkaopt3 = $skidkaopt3;
return $this;
}
public function getSkidkaopt4(): ?float
{
return $this->skidkaopt4;
}
public function setSkidkaopt4(float $skidkaopt4): self
{
$this->skidkaopt4 = $skidkaopt4;
return $this;
}
public function getNumdiscount(): array
{
return Env::is_opt() ? $this->numdiscountopt : $this->numdiscount;
}
public function setNumdiscount(array $numdiscount): self
{
$this->numdiscount = $numdiscount;
return $this;
}
public function getNumdiscount2(): array
{
return Env::is_opt() ? $this->numdiscountopt2 : $this->numdiscount2;
}
public function setNumdiscount2(array $numdiscount2): self
{
$this->numdiscount2 = $numdiscount2;
return $this;
}
public function getNumdiscount3(): array
{
return Env::is_opt() ? $this->numdiscountopt3 : $this->numdiscount3;
}
public function setNumdiscount3(array $numdiscount3): self
{
$this->numdiscount3 = $numdiscount3;
return $this;
}
public function getNumdiscount4(): array
{
return Env::is_opt() ? $this->numdiscountopt4 : $this->numdiscount4;
}
public function setNumdiscount4(array $numdiscount4): self
{
$this->numdiscount4 = $numdiscount4;
return $this;
}
public function getNumdiscountopt(): array
{
return $this->numdiscountopt;
}
public function setNumdiscountopt(array $numdiscountopt): self
{
$this->numdiscountopt = $numdiscountopt;
return $this;
}
public function getNumdiscountopt2(): array
{
return $this->numdiscountopt2;
}
public function setNumdiscountopt2(array $numdiscountopt2): self
{
$this->numdiscountopt2 = $numdiscountopt2;
return $this;
}
public function getNumdiscountopt3(): array
{
return $this->numdiscountopt3;
}
public function setNumdiscountopt3(array $numdiscountopt3): self
{
$this->numdiscountopt3 = $numdiscountopt3;
return $this;
}
public function getNumdiscountopt4(): array
{
return $this->numdiscountopt4;
}
public function setNumdiscountopt4(array $numdiscountopt4): self
{
$this->numdiscountopt4 = $numdiscountopt4;
return $this;
}
public function getNum(): ?int
{
return $this->num;
}
public function setNum(int $num): self
{
$this->num = $num;
return $this;
}
public function getNum2(): ?int
{
return $this->num2;
}
public function setNum2(int $num2): self
{
$this->num2 = $num2;
return $this;
}
public function getNum3(): ?int
{
return $this->num3;
}
public function setNum3(int $num3): self
{
$this->num3 = $num3;
return $this;
}
public function getNum4(): ?int
{
return $this->num4;
}
public function setNum4(int $num4): self
{
$this->num4 = $num4;
return $this;
}
public function getInpack(): ?string
{
return $this->inpack;
}
public function setInpack(string $inpack): self
{
$this->inpack = $inpack;
return $this;
}
public function getInpack2(): ?string
{
return $this->inpack2;
}
public function setInpack2(string $inpack2): self
{
$this->inpack2 = $inpack2;
return $this;
}
public function getInpack3(): ?string
{
return $this->inpack3;
}
public function setInpack3(string $inpack3): self
{
$this->inpack3 = $inpack3;
return $this;
}
public function getInpack4(): ?string
{
return $this->inpack4;
}
public function setInpack4(string $inpack4): self
{
$this->inpack4 = $inpack4;
return $this;
}
public function getWeight(): ?int
{
return $this->weight;
}
public function setWeight(int $weight): self
{
$this->weight = $weight;
return $this;
}
public function getWeight2(): ?int
{
return $this->weight2;
}
public function setWeight2(int $weight2): self
{
$this->weight2 = $weight2;
return $this;
}
public function getWeight3(): ?int
{
return $this->weight3;
}
public function setWeight3(int $weight3): self
{
$this->weight3 = $weight3;
return $this;
}
public function getWeight4(): ?int
{
return $this->weight4;
}
public function setWeight4(int $weight4): self
{
$this->weight4 = $weight4;
return $this;
}
public function isVisible(): ?bool
{
return $this->visible;
}
public function setVisible(bool $visible): self
{
$this->visible = $visible;
return $this;
}
public function isPop(): ?bool
{
return $this->pop;
}
public function setPop(bool $pop): self
{
$this->pop = $pop;
return $this;
}
public function isAction(): ?bool
{
return $this->action;
}
public function setAction(bool $action): self
{
$this->action = $action;
return $this;
}
public function isMix(): ?bool
{
return $this->mix;
}
public function setMix(bool $mix): self
{
$this->mix = $mix;
return $this;
}
public function isMain(): ?bool
{
return $this->main;
}
public function setMain(bool $main): self
{
$this->main = $main;
return $this;
}
public function isNew(): ?bool
{
return $this->new;
}
public function setNew(bool $new): self
{
$this->new = $new;
return $this;
}
public function isSale(): ?bool
{
return $this->sale;
}
public function setSale(bool $sale): self
{
$this->sale = $sale;
return $this;
}
public function isOnsale(): ?bool
{
return $this->onsale;
}
public function setOnsale(bool $onsale): self
{
$this->onsale = $onsale;
return $this;
}
public function getPrior(): ?int
{
return $this->prior;
}
public function setPrior(int $prior): self
{
$this->prior = $prior;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDescr(): ?string
{
return $this->descr;
}
public function setDescr(string $descr): self
{
$this->descr = $descr;
return $this;
}
public function getKw(): ?string
{
return $this->kw;
}
public function setKw(string $kw): self
{
$this->kw = $kw;
return $this;
}
public function getH1(): ?string
{
return $this->h1;
}
public function setH1(string $h1): self
{
$this->h1 = $h1;
return $this;
}
public function getRating(): ?int
{
return $this->rating;
}
public function setRating(int $rating): self
{
$this->rating = $rating;
return $this;
}
public function getSpec(): ?string
{
return $this->spec;
}
public function setSpec(string $spec): self
{
$this->spec = $spec;
return $this;
}
public function getOrdered(): ?int
{
return $this->ordered;
}
public function setOrdered(int $ordered): self
{
$this->ordered = $ordered;
return $this;
}
public function getIzm(): ?string
{
return $this->izm;
}
public function setIzm(string $izm): self
{
$this->izm = $izm;
return $this;
}
public function getPic(): ?string
{
return $this->pic;
}
public function setPic(string $pic): self
{
$this->pic = $pic;
return $this;
}
public function getViews(): ?int
{
return $this->views;
}
public function setViews(int $views): self
{
$this->views = $views;
return $this;
}
public function isJustuploaded(): ?bool
{
return $this->justuploaded;
}
public function setJustuploaded(bool $justuploaded): self
{
$this->justuploaded = $justuploaded;
return $this;
}
public function getUploaded(): ?int
{
return $this->uploaded;
}
public function setUploaded(int $uploaded): self
{
$this->uploaded = $uploaded;
return $this;
}
public function getChanged(): ?int
{
return $this->changed;
}
public function setChanged(int $changed): self
{
$this->changed = $changed;
return $this;
}
public function getColors(): array
{
if(!in_array($this->getId(), $this->colors)) {
$this->colors = [];
array_push($this->colors, $this->getId());
}
sort($this->colors);
return $this->colors;
}
public function setColors(array $colors): self
{
$this->colors = $colors;
return $this;
}
public function getSku(): ?string
{
return $this->sku;
}
public function setSku(string $sku): self
{
$this->sku = $sku;
return $this;
}
public function getModel(): ?string
{
return $this->model;
}
public function setModel(string $model): self
{
$this->model = $model;
return $this;
}
public function getChars(): ?string
{
return $this->chars;
}
public function setChars(string $chars): self
{
$this->chars = $chars;
return $this;
}
public function getTags(): ?string
{
return $this->tags;
}
public function setTags(string $tags): self
{
$this->tags = $tags;
return $this;
}
public function getExternalId(): ?string
{
return $this->externalId;
}
public function setExternalId(?string $externalId): self
{
$this->externalId = $externalId;
return $this;
}
}