<?php
namespace App\Entity;
use Doctrine\ORM\Mapping\Index;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\CatRepository;
use Gedmo\Translatable\Translatable;
use App\Entity\Translation\CatTranslation;
use App\Entity\Translation\PageTranslation;
use Doctrine\Common\Collections\Collection;
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: CatRepository::class)]
#[TranslationEntity(class: CatTranslation::class)]
#[Index(name: "cat_visible", columns: ["visible"])]
#[Index(name: "cat_par", columns: ["cat"])]
#[Index(name: "cat_intname", columns: ["intname"])]
class Cat implements EntityInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'integer')]
private $cat = 0;
#[ORM\Column(type: 'string', length: 255)]
private $intname = '';
#[GedmoTranslatable]
#[ORM\Column(type: 'string', length: 255)]
private $name = '';
#[GedmoTranslatable]
#[ORM\Column(type: 'string', length: 1000)]
private $short = '';
#[GedmoTranslatable]
#[ORM\Column(type: 'text')]
private $cont = '';
#[GedmoTranslatable]
#[ORM\Column(type: 'text')]
private $cont2 = '';
#[ORM\Column(type: 'smallint')]
private $prior = 0;
#[ORM\Column(type: 'boolean')]
private $visible = 1;
#[ORM\Column(type: 'boolean')]
private $spec = 0;
#[ORM\Column(type: 'boolean')]
private $newlabel = 0;
#[ORM\Column(type: 'boolean')]
private $inprice = 1;
#[ORM\Column(type: 'boolean')]
private $incatalog = 1;
#[ORM\Column(type: 'boolean')]
private $notinxml = 0;
#[GedmoTranslatable]
#[ORM\Column(type: 'string', length: 1000)]
private $title = '';
#[GedmoTranslatable]
#[ORM\Column(type: 'string', length: 255)]
private $h1 = '';
#[GedmoTranslatable]
#[ORM\Column(type: 'string', length: 255)]
private $kw = '';
#[GedmoTranslatable]
#[ORM\Column(type: 'string', length: 1000)]
private $descr = '';
#[ORM\Column(type: 'string', length: 255)]
private $pic = '';
#[GedmoLocale]
private $locale;
#[ORM\OneToMany(targetEntity: CatTranslation::class, mappedBy: 'object', cascade: ['persist', 'remove'])]
private $translations;
public array $subcats = [];
public function __construct()
{
$this->translations = new ArrayCollection();
}
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getTranslations()
{
return $this->translations;
}
public function addTranslation(CatTranslation $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 getShort(): ?string
{
return $this->short;
}
public function setShort(string $short): self
{
$this->short = $short;
return $this;
}
public function getCont(): ?string
{
return $this->cont;
}
public function setCont(string $cont): self
{
$this->cont = $cont;
return $this;
}
public function getCont2(): ?string
{
return $this->cont2;
}
public function setCont2(string $cont2): self
{
$this->cont2 = $cont2;
return $this;
}
public function getPrior(): ?int
{
return $this->prior;
}
public function setPrior(int $prior): self
{
$this->prior = $prior;
return $this;
}
public function isVisible(): ?bool
{
return $this->visible;
}
public function setVisible(bool $visible): self
{
$this->visible = $visible;
return $this;
}
public function isSpec(): ?bool
{
return $this->spec;
}
public function setSpec(bool $spec): self
{
$this->spec = $spec;
return $this;
}
public function isNewlabel(): ?bool
{
return $this->newlabel;
}
public function setNewlabel(bool $newlabel): self
{
$this->newlabel = $newlabel;
return $this;
}
public function isInprice(): ?bool
{
return $this->inprice;
}
public function setInprice(bool $inprice): self
{
$this->inprice = $inprice;
return $this;
}
public function isIncatalog(): ?bool
{
return $this->incatalog;
}
public function setIncatalog(bool $incatalog): self
{
$this->incatalog = $incatalog;
return $this;
}
public function isNotinxml(): ?bool
{
return $this->notinxml;
}
public function setNotinxml(bool $notinxml): self
{
$this->notinxml = $notinxml;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getH1(): ?string
{
return $this->h1;
}
public function setH1(string $h1): self
{
$this->h1 = $h1;
return $this;
}
public function getKw(): ?string
{
return $this->kw;
}
public function setKw(string $kw): self
{
$this->kw = $kw;
return $this;
}
public function getDescr(): ?string
{
return $this->descr;
}
public function setDescr(string $descr): self
{
$this->descr = $descr;
return $this;
}
public function getPic(): ?string
{
return $this->pic;
}
public function setPic(string $pic): self
{
$this->pic = $pic;
return $this;
}
}