src/Entity/Product.php line 16

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\MainTranslationTrait;
  4. use App\Entity\Translation\ProductTranslation;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Translatable\Translatable;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. #[Gedmo\TranslationEntity(class: self::TRANSLATION_ENTITY)]
  12. #[ORM\Entity()]
  13. class Product implements Translatable
  14. {
  15.     use MainTranslationTrait;
  16.     const TRANSLATION_ENTITY ProductTranslation::class;
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue]
  19.     #[ORM\Column]
  20.     private ?int $id null;
  21.     #[ORM\Column(type'string',nullabletrue)]
  22.     #[Gedmo\Translatable]
  23.     private ?string $title null;
  24.     #[ORM\Column(type'integer',nullabletrue)]
  25.     private ?int $productType null;
  26.     #[ORM\Column(type'string'length65nullabletrue)]
  27.     #[Gedmo\Translatable]
  28.     private ?string $metaTitle null;
  29.     #[ORM\Column(type'string',length165,nullabletrue)]
  30.     #[Gedmo\Translatable]
  31.     private ?string $metaDescription null;
  32.     #[ORM\Column(type'string',nullabletrue)]
  33.     private ?string $metaImage null;
  34.     #[ORM\Column(type'string',nullabletrue)]
  35.     private ?string $image null;
  36.     #[ORM\Column(type'string',nullabletrue)]
  37.     private ?string $minImage null;
  38.     #[ORM\Column(type'string',nullabletrue)]
  39.     private ?string $miniSecondImage null;
  40.     #[ORM\Column(type'text',nullabletrue)]
  41.     #[Gedmo\Translatable]
  42.     private mixed $productDescription null;
  43.     #[ORM\Column(type'string',nullabletrue)]
  44.     #[Gedmo\Translatable]
  45.     private mixed $type null;
  46.     #[ORM\Column(type'string',nullabletrue)]
  47.     #[Gedmo\Translatable]
  48.     private mixed $weight null;
  49.     #[ORM\Column(type'string',nullabletrue)]
  50.     #[Gedmo\Translatable]
  51.     private mixed $gold null;
  52.     #[ORM\Column(type'string',nullabletrue)]
  53.     #[Gedmo\Translatable]
  54.     private mixed $stone null;
  55.     #[ORM\Column(type'float',nullabletrue)]
  56.     private ?float $price null;
  57.     #[ORM\Column(type'string',nullabletrue)]
  58.     private ?string $refNumber null;
  59.     #[ORM\ManyToOne(inversedBy'products')]
  60.     #[ORM\JoinColumn(nullabletrue)]
  61.     private ?Category $category null;
  62.     #[ORM\ManyToOne(inversedBy'products')]
  63.     #[ORM\JoinColumn(nullabletrue)]
  64.     private \App\Entity\Collection|null $collection null;
  65.     #[ORM\ManyToMany(targetEntityTag::class)]
  66.     private Collection $tags;
  67.     public function __construct()
  68.     {
  69.         $this->tags = new ArrayCollection();
  70.     }
  71.     /**
  72.      * @return int|null
  73.      */
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     /**
  79.      * @param int|null $id
  80.      */
  81.     public function setId(?int $id): void
  82.     {
  83.         $this->id $id;
  84.     }
  85.     /**
  86.      * @return string|null
  87.      */
  88.     public function getTitle(): ?string
  89.     {
  90.         return $this->title;
  91.     }
  92.     /**
  93.      * @param string|null $title
  94.      */
  95.     public function setTitle(?string $title): void
  96.     {
  97.         $this->title $title;
  98.     }
  99.     /**
  100.      * @return string|null
  101.      */
  102.     public function getImage(): ?string
  103.     {
  104.         return $this->image;
  105.     }
  106.     /**
  107.      * @param string|null $image
  108.      */
  109.     public function setImage(?string $image): void
  110.     {
  111.         $this->image $image;
  112.     }
  113.     /**
  114.      * @return mixed|null
  115.      */
  116.     public function getProductDescription(): mixed
  117.     {
  118.         return $this->productDescription;
  119.     }
  120.     /**
  121.      * @param mixed|null $productDescription
  122.      */
  123.     public function setProductDescription(mixed $productDescription): void
  124.     {
  125.         $this->productDescription $productDescription;
  126.     }
  127.     public function getType(): ?string
  128.     {
  129.         return $this->type;
  130.     }
  131.     public function setType(?string $type): self
  132.     {
  133.         $this->type $type;
  134.         return $this;
  135.     }
  136.     public function getWeight(): ?string
  137.     {
  138.         return $this->weight;
  139.     }
  140.     public function setWeight(?string $weight): self
  141.     {
  142.         $this->weight $weight;
  143.         return $this;
  144.     }
  145.     public function getStone(): ?string
  146.     {
  147.         return $this->stone;
  148.     }
  149.     public function setStone(?string $stone): self
  150.     {
  151.         $this->stone $stone;
  152.         return $this;
  153.     }
  154.     /**
  155.      * @return float|null
  156.      */
  157.     public function getPrice(): ?float
  158.     {
  159.         return $this->price;
  160.     }
  161.     /**
  162.      * @param float|null $price
  163.      */
  164.     public function setPrice(?float $price): void
  165.     {
  166.         $this->price $price;
  167.     }
  168.     /**
  169.      * @return string|null
  170.      */
  171.     public function getRefNumber(): ?string
  172.     {
  173.         return $this->refNumber;
  174.     }
  175.     /**
  176.      * @param string|null $refNumber
  177.      */
  178.     public function setRefNumber(?string $refNumber): void
  179.     {
  180.         $this->refNumber $refNumber;
  181.     }
  182.     public function getCategory(): ?Category
  183.     {
  184.         return $this->category;
  185.     }
  186.     public function setCategory(?Category $category): self
  187.     {
  188.         $this->category $category;
  189.         return $this;
  190.     }
  191.     public function getCollection(): ?\App\Entity\Collection
  192.     {
  193.         return $this->collection;
  194.     }
  195.     public function setCollection(?\App\Entity\Collection $collection): self
  196.     {
  197.         $this->collection $collection;
  198.         return $this;
  199.     }
  200.     /**
  201.      * @return Collection<int, Tag>
  202.      */
  203.     public function getTags(): Collection
  204.     {
  205.         return $this->tags;
  206.     }
  207.     public function addTag(Tag $tag): self
  208.     {
  209.         if (!$this->tags->contains($tag)) {
  210.             $this->tags->add($tag);
  211.         }
  212.         return $this;
  213.     }
  214.     public function removeTag(Tag $tag): self
  215.     {
  216.         $this->tags->removeElement($tag);
  217.         return $this;
  218.     }
  219.     /**
  220.      * @return string|null
  221.      */
  222.     public function getMinImage(): ?string
  223.     {
  224.         return $this->minImage;
  225.     }
  226.     /**
  227.      * @param string|null $minImage
  228.      */
  229.     public function setMinImage(?string $minImage): void
  230.     {
  231.         $this->minImage $minImage;
  232.     }
  233.     /**
  234.      * @return string|null
  235.      */
  236.     public function getMiniSecondImage(): ?string
  237.     {
  238.         return $this->miniSecondImage;
  239.     }
  240.     /**
  241.      * @param string|null $miniSecondImage
  242.      */
  243.     public function setMiniSecondImage(?string $miniSecondImage): void
  244.     {
  245.         $this->miniSecondImage $miniSecondImage;
  246.     }
  247.     public function getGold(): ?string
  248.     {
  249.         return $this->gold;
  250.     }
  251.     public function setGold(?string $gold): static
  252.     {
  253.         $this->gold $gold;
  254.         return $this;
  255.     }
  256.     /**
  257.      * @return string|null
  258.      */
  259.     public function getMetaTitle(): ?string
  260.     {
  261.         return $this->metaTitle;
  262.     }
  263.     /**
  264.      * @param string|null $metaTitle
  265.      */
  266.     public function setMetaTitle(?string $metaTitle): void
  267.     {
  268.         $this->metaTitle $metaTitle;
  269.     }
  270.     /**
  271.      * @return string|null
  272.      */
  273.     public function getMetaDescription(): ?string
  274.     {
  275.         return $this->metaDescription;
  276.     }
  277.     /**
  278.      * @param string|null $metaDescription
  279.      */
  280.     public function setMetaDescription(?string $metaDescription): void
  281.     {
  282.         $this->metaDescription $metaDescription;
  283.     }
  284.     /**
  285.      * @return string|null
  286.      */
  287.     public function getMetaImage(): ?string
  288.     {
  289.         return $this->metaImage;
  290.     }
  291.     /**
  292.      * @param string|null $metaImage
  293.      */
  294.     public function setMetaImage(?string $metaImage): void
  295.     {
  296.         $this->metaImage $metaImage;
  297.     }
  298.     /**
  299.      * @return int|null
  300.      */
  301.     public function getProductType(): ?int
  302.     {
  303.         return $this->productType;
  304.     }
  305.     /**
  306.      * @param int|null $productType
  307.      */
  308.     public function setProductType(?int $productType): void
  309.     {
  310.         $this->productType $productType;
  311.     }
  312. }