src/Entity/Cat.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping\Index;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\CatRepository;
  6. use Gedmo\Translatable\Translatable;
  7. use App\Entity\Translation\CatTranslation;
  8. use App\Entity\Translation\PageTranslation;
  9. use Doctrine\Common\Collections\Collection;
  10. use Gedmo\Mapping\Annotation\TranslationEntity;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
  13. use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
  14. #[ORM\Entity(repositoryClassCatRepository::class)]
  15. #[TranslationEntity(class: CatTranslation::class)]
  16. #[Index(name"cat_visible"columns: ["visible"])]
  17. #[Index(name"cat_par"columns: ["cat"])]
  18. #[Index(name"cat_intname"columns: ["intname"])]
  19. class Cat implements EntityInterface
  20. {
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column(type'integer')]
  24.     private $id;
  25.     #[ORM\Column(type'integer')]
  26.     private $cat 0;
  27.     #[ORM\Column(type'string'length255)]
  28.     private $intname '';
  29.     #[GedmoTranslatable]
  30.     #[ORM\Column(type'string'length255)]
  31.     private $name '';
  32.     #[GedmoTranslatable]
  33.     #[ORM\Column(type'string'length1000)]
  34.     private $short '';
  35.     #[GedmoTranslatable]
  36.     #[ORM\Column(type'text')]
  37.     private $cont '';
  38.     #[GedmoTranslatable]
  39.     #[ORM\Column(type'text')]
  40.     private $cont2 '';
  41.     #[ORM\Column(type'smallint')]
  42.     private $prior 0;
  43.     #[ORM\Column(type'boolean')]
  44.     private $visible 1;
  45.     #[ORM\Column(type'boolean')]
  46.     private $spec 0;
  47.     #[ORM\Column(type'boolean')]
  48.     private $newlabel 0;
  49.     #[ORM\Column(type'boolean')]
  50.     private $inprice 1;
  51.     #[ORM\Column(type'boolean')]
  52.     private $incatalog 1;
  53.     #[ORM\Column(type'boolean')]
  54.     private $notinxml 0;
  55.     #[GedmoTranslatable]
  56.     #[ORM\Column(type'string'length1000)]
  57.     private $title '';
  58.     #[GedmoTranslatable]
  59.     #[ORM\Column(type'string'length255)]
  60.     private $h1 '';
  61.     #[GedmoTranslatable]
  62.     #[ORM\Column(type'string'length255)]
  63.     private $kw '';
  64.     #[GedmoTranslatable]
  65.     #[ORM\Column(type'string'length1000)]
  66.     private $descr '';
  67.     #[ORM\Column(type'string'length255)]
  68.     private $pic '';
  69.     #[GedmoLocale]
  70.     private $locale;
  71.     #[ORM\OneToMany(targetEntityCatTranslation::class, mappedBy'object'cascade: ['persist''remove'])]
  72.     private $translations;
  73.     public array $subcats = [];
  74.     public function __construct()
  75.     {
  76.         $this->translations = new ArrayCollection();
  77.     }
  78.     public function setLocale($locale)
  79.     {
  80.         $this->locale $locale;
  81.     }
  82.     public function getTranslations()
  83.     {
  84.         return $this->translations;
  85.     }
  86.     public function addTranslation(CatTranslation $t)
  87.     {
  88.         if (!$this->translations->contains($t)) {
  89.             $this->translations[] = $t;
  90.             $t->setObject($this);
  91.         }
  92.     }
  93.     public function getId(): ?int
  94.     {
  95.         return $this->id;
  96.     }
  97.     public function getCat(): ?int
  98.     {
  99.         return $this->cat;
  100.     }
  101.     public function setCat(int $cat): self
  102.     {
  103.         $this->cat $cat;
  104.         return $this;
  105.     }
  106.     public function getIntname(): ?string
  107.     {
  108.         return $this->intname;
  109.     }
  110.     public function setIntname(string $intname): self
  111.     {
  112.         $this->intname $intname;
  113.         return $this;
  114.     }
  115.     public function getName(): ?string
  116.     {
  117.         return $this->name;
  118.     }
  119.     public function setName(string $name): self
  120.     {
  121.         $this->name $name;
  122.         return $this;
  123.     }
  124.     public function getShort(): ?string
  125.     {
  126.         return $this->short;
  127.     }
  128.     public function setShort(string $short): self
  129.     {
  130.         $this->short $short;
  131.         return $this;
  132.     }
  133.     public function getCont(): ?string
  134.     {
  135.         return $this->cont;
  136.     }
  137.     public function setCont(string $cont): self
  138.     {
  139.         $this->cont $cont;
  140.         return $this;
  141.     }
  142.     public function getCont2(): ?string
  143.     {
  144.         return $this->cont2;
  145.     }
  146.     public function setCont2(string $cont2): self
  147.     {
  148.         $this->cont2 $cont2;
  149.         return $this;
  150.     }
  151.     public function getPrior(): ?int
  152.     {
  153.         return $this->prior;
  154.     }
  155.     public function setPrior(int $prior): self
  156.     {
  157.         $this->prior $prior;
  158.         return $this;
  159.     }
  160.     public function isVisible(): ?bool
  161.     {
  162.         return $this->visible;
  163.     }
  164.     public function setVisible(bool $visible): self
  165.     {
  166.         $this->visible $visible;
  167.         return $this;
  168.     }
  169.     public function isSpec(): ?bool
  170.     {
  171.         return $this->spec;
  172.     }
  173.     public function setSpec(bool $spec): self
  174.     {
  175.         $this->spec $spec;
  176.         return $this;
  177.     }
  178.     public function isNewlabel(): ?bool
  179.     {
  180.         return $this->newlabel;
  181.     }
  182.     public function setNewlabel(bool $newlabel): self
  183.     {
  184.         $this->newlabel $newlabel;
  185.         return $this;
  186.     }
  187.     public function isInprice(): ?bool
  188.     {
  189.         return $this->inprice;
  190.     }
  191.     public function setInprice(bool $inprice): self
  192.     {
  193.         $this->inprice $inprice;
  194.         return $this;
  195.     }
  196.     public function isIncatalog(): ?bool
  197.     {
  198.         return $this->incatalog;
  199.     }
  200.     public function setIncatalog(bool $incatalog): self
  201.     {
  202.         $this->incatalog $incatalog;
  203.         return $this;
  204.     }
  205.     public function isNotinxml(): ?bool
  206.     {
  207.         return $this->notinxml;
  208.     }
  209.     public function setNotinxml(bool $notinxml): self
  210.     {
  211.         $this->notinxml $notinxml;
  212.         return $this;
  213.     }
  214.     public function getTitle(): ?string
  215.     {
  216.         return $this->title;
  217.     }
  218.     public function setTitle(string $title): self
  219.     {
  220.         $this->title $title;
  221.         return $this;
  222.     }
  223.     public function getH1(): ?string
  224.     {
  225.         return $this->h1;
  226.     }
  227.     public function setH1(string $h1): self
  228.     {
  229.         $this->h1 $h1;
  230.         return $this;
  231.     }
  232.     public function getKw(): ?string
  233.     {
  234.         return $this->kw;
  235.     }
  236.     public function setKw(string $kw): self
  237.     {
  238.         $this->kw $kw;
  239.         return $this;
  240.     }
  241.     public function getDescr(): ?string
  242.     {
  243.         return $this->descr;
  244.     }
  245.     public function setDescr(string $descr): self
  246.     {
  247.         $this->descr $descr;
  248.         return $this;
  249.     }
  250.     public function getPic(): ?string
  251.     {
  252.         return $this->pic;
  253.     }
  254.     public function setPic(string $pic): self
  255.     {
  256.         $this->pic $pic;
  257.         return $this;
  258.     }
  259. }