src/Entity/Material.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MaterialRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. #[ORM\Entity(repositoryClassMaterialRepository::class)]
  9. #[Vich\Uploadable]
  10. class Material
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type"integer")]
  15.     #[Groups(["products"])]
  16.     private $id;
  17.     #[ORM\Column(type"string"length255)]
  18.     #[Groups(["products"])]
  19.     private $title;
  20.     #[ORM\Column(type"string"length2048nullabletrue)]
  21.     #[Groups(["products"])]
  22.     private $description;
  23.     #[ORM\Column(type"string"length255nullabletrue)]
  24.     #[Groups(["products"])]
  25.     private $thumbnail;
  26.     #[Vich\UploadableField(mapping"product_images"fileNameProperty"thumbnail")]
  27.     private $thumbnailFile;
  28.     #[ORM\Column(type"string"length255nullabletrue)]
  29.     #[Groups(["products"])]
  30.     private $colorHex;
  31.     #[ORM\Column(type"string"length255nullabletrue)]
  32.     #[Groups(["products"])]
  33.     private $albedoTexture;
  34.     #[Vich\UploadableField(mapping"textures"fileNameProperty"albedoTexture")]
  35.     private $albedoTextureFile;
  36.     #[ORM\Column(type"string"length255nullabletrue)]
  37.     #[Groups(["products"])]
  38.     private $normalMapTexture;
  39.     #[Vich\UploadableField(mapping"textures"fileNameProperty"normalMapTexture")]
  40.     private $normalMapTextureFile;
  41.     #[ORM\Column(type"string"length255nullabletrue)]
  42.     #[Groups(["products"])]
  43.     private $metallicMapTexture;
  44.     #[Vich\UploadableField(mapping"textures"fileNameProperty"metallicMapTexture")]
  45.     private $metallicMapTextureFile;
  46.     #[ORM\Column(type"string"length255nullabletrue)]
  47.     #[Groups(["products"])]
  48.     private $heightMapTexture;
  49.     #[Vich\UploadableField(mapping"textures"fileNameProperty"heightMapTexture")]
  50.     private $heightMapTextureFile;
  51.     #[ORM\Column(type"string"length255nullabletrue)]
  52.     #[Groups(["products"])]
  53.     private $occlusionMapTexture;
  54.     #[Vich\UploadableField(mapping"textures"fileNameProperty"occlusionMapTexture")]
  55.     private $occlusionMapTextureFile;
  56.     #[ORM\Column(type"float"nullabletrue)]
  57.     #[Groups(["products"])]
  58.     private $opacity;
  59.     #[ORM\Column(type"datetime"nullabletrue)]
  60.     #[Groups(["products"])]
  61.     private ?\DateTime $updatedAt;
  62.     #[ORM\ManyToMany(targetEntity"Pfosten"mappedBy"compatibleMaterial")]
  63.     private $pfosten;
  64.     #[ORM\ManyToMany(targetEntity"Zaunelement"mappedBy"compatibleMaterial")]
  65.     private $zaunelement;
  66.     #[ORM\ManyToMany(targetEntity"Terrasse"mappedBy"compatibleMaterial")]
  67.     private $terrasse;
  68.     #[ORM\ManyToMany(targetEntity"Accessories"mappedBy"compatibleMaterial")]
  69.     private $accessories;
  70.     #[ORM\Column(type"float"nullabletrue)]
  71.     #[Groups(["products"])]
  72.     private $textureTilingX;
  73.     #[ORM\Column(type"float"nullabletrue)]
  74.     #[Groups(["products"])]
  75.     private $textureTilingY;
  76.     #[ORM\Column(type"float"nullabletrue)]
  77.     #[Groups(["products"])]
  78.     private $smoothness;
  79.     #[ORM\Column(type"float"nullabletrue)]
  80.     #[Groups(["products"])]
  81.     private $heightMapIntensity;
  82.     #[ORM\Column(type"float"nullabletrue)]
  83.     #[Groups(["products"])]
  84.     private $normalMapIntensity;
  85.     #[ORM\Column(type"float"nullabletrue)]
  86.     #[Groups(["products"])]
  87.     private $occlusionMapIntensity;
  88.     #[ORM\Column(type"float"nullabletrue)]
  89.     #[Groups(["products"])]
  90.     private $metallicMapIntensity;
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getTitle(): ?string
  96.     {
  97.         return $this->title;
  98.     }
  99.     public function setTitle(string $title): self
  100.     {
  101.         $this->title $title;
  102.         return $this;
  103.     }
  104.     public function getDescription(): ?string
  105.     {
  106.         return $this->description;
  107.     }
  108.     public function setDescription(?string $description): self
  109.     {
  110.         $this->description $description;
  111.         return $this;
  112.     }
  113.     public function getThumbnail(): ?string
  114.     {
  115.         return $this->thumbnail;
  116.     }
  117.     public function setThumbnail(?string $thumbnail): self
  118.     {
  119.         $this->thumbnail $thumbnail;
  120.         return $this;
  121.     }
  122.     public function getColorHex(): ?string
  123.     {
  124.         return $this->colorHex;
  125.     }
  126.     public function setColorHex(?string $colorHex): self
  127.     {
  128.         $this->colorHex $colorHex;
  129.         return $this;
  130.     }
  131.     public function getAlbedoTexture(): ?string
  132.     {
  133.         return $this->albedoTexture;
  134.     }
  135.     public function setAlbedoTexture(?string $albedoTexture): self
  136.     {
  137.         $this->albedoTexture $albedoTexture;
  138.         return $this;
  139.     }
  140.     public function getNormalMapTexture(): ?string
  141.     {
  142.         return $this->normalMapTexture;
  143.     }
  144.     public function setNormalMapTexture(?string $normalMapTexture): self
  145.     {
  146.         $this->normalMapTexture $normalMapTexture;
  147.         return $this;
  148.     }
  149.     public function getMetallicMapTexture(): ?string
  150.     {
  151.         return $this->metallicMapTexture;
  152.     }
  153.     public function setMetallicMapTexture(?string $metallicMapTexture): self
  154.     {
  155.         $this->metallicMapTexture $metallicMapTexture;
  156.         return $this;
  157.     }
  158.     public function getHeightMapTexture(): ?string
  159.     {
  160.         return $this->heightMapTexture;
  161.     }
  162.     public function setHeightMapTexture(?string $heightMapTexture): self
  163.     {
  164.         $this->heightMapTexture $heightMapTexture;
  165.         return $this;
  166.     }
  167.     public function getOcclusionMapTexture(): ?string
  168.     {
  169.         return $this->occlusionMapTexture;
  170.     }
  171.     public function setOcclusionMapTexture(?string $occlusionMapTexture): self
  172.     {
  173.         $this->occlusionMapTexture $occlusionMapTexture;
  174.         return $this;
  175.     }
  176.     public function getOpacity(): ?float
  177.     {
  178.         return $this->opacity;
  179.     }
  180.     public function setOpacity(?float $opacity): self
  181.     {
  182.         $this->opacity $opacity;
  183.         return $this;
  184.     }
  185.     /**
  186.      * @param File|null $thumbnail
  187.      */
  188.     public function setThumbnailFile(File $thumbnail null)
  189.     {
  190.         $this->thumbnailFile $thumbnail;
  191.        //exit(var_dump($thumbnail));
  192.         // VERY IMPORTANT:
  193.         // It is required that at least one field changes if you are using Doctrine,
  194.         // otherwise the event listeners won't be called and the file is lost
  195.         if ($thumbnail) {
  196.             // if 'updatedAt' is not defined in your entity, use another property
  197.             $this->updatedAt = new \DateTime('now');
  198.         }
  199.     }
  200.     /**
  201.      * @return null|File
  202.      */
  203.     public function getThumbnailFile(): ?File
  204.     {
  205.         return $this->thumbnailFile;
  206.     }
  207.     /**
  208.      * @param File|null $albedoTextureFile
  209.      */
  210.     public function setAlbedoTextureFile(File $albedoTextureFile null)
  211.     {
  212.         $this->albedoTextureFile $albedoTextureFile;
  213.         // VERY IMPORTANT:
  214.         // It is required that at least one field changes if you are using Doctrine,
  215.         // otherwise the event listeners won't be called and the file is lost
  216.         if ($albedoTextureFile) {
  217.             // if 'updatedAt' is not defined in your entity, use another property
  218.             $this->updatedAt = new \DateTime('now');
  219.         }
  220.     }
  221.     /**
  222.      * @return File
  223.      */
  224.     public function getAlbedoTextureFile()
  225.     {
  226.         return $this->albedoTextureFile;
  227.     }
  228.     /**
  229.      * @param File|null $normalMapTextureFile
  230.      */
  231.     public function setNormalMapTextureFile(File $normalMapTextureFile null)
  232.     {
  233.         $this->normalMapTextureFile $normalMapTextureFile;
  234.         // VERY IMPORTANT:
  235.         // It is required that at least one field changes if you are using Doctrine,
  236.         // otherwise the event listeners won't be called and the file is lost
  237.         if ($normalMapTextureFile) {
  238.             // if 'updatedAt' is not defined in your entity, use another property
  239.             $this->updatedAt = new \DateTime('now');
  240.         }
  241.     }
  242.     /**
  243.      * @return File
  244.      */
  245.     public function getNormalMapTextureFile()
  246.     {
  247.         return $this->normalMapTextureFile;
  248.     }
  249.     /**
  250.      * @param File|null $metallicMapTextureFile
  251.      */
  252.     public function setMetallicMapTextureFile(File $metallicMapTextureFile null)
  253.     {
  254.         $this->metallicMapTextureFile $metallicMapTextureFile;
  255.         // VERY IMPORTANT:
  256.         // It is required that at least one field changes if you are using Doctrine,
  257.         // otherwise the event listeners won't be called and the file is lost
  258.         if ($metallicMapTextureFile) {
  259.             // if 'updatedAt' is not defined in your entity, use another property
  260.             $this->updatedAt = new \DateTime('now');
  261.         }
  262.     }
  263.     /**
  264.      * @return File
  265.      */
  266.     public function getMetallicMapTextureFile()
  267.     {
  268.         return $this->metallicMapTextureFile;
  269.     }
  270.     /**
  271.      * @param File|null $heightMapTextureFile
  272.      */
  273.     public function setHeightMapTextureFile(File $heightMapTextureFile null)
  274.     {
  275.         $this->heightMapTextureFile $heightMapTextureFile;
  276.         // VERY IMPORTANT:
  277.         // It is required that at least one field changes if you are using Doctrine,
  278.         // otherwise the event listeners won't be called and the file is lost
  279.         if ($heightMapTextureFile) {
  280.             // if 'updatedAt' is not defined in your entity, use another property
  281.             $this->updatedAt = new \DateTime('now');
  282.         }
  283.     }
  284.     /**
  285.      * @return File
  286.      */
  287.     public function getHeightMapTextureFile()
  288.     {
  289.         return $this->heightMapTextureFile;
  290.     }
  291.     /**
  292.      * @param File|null $occlusionMapTextureFile
  293.      */
  294.     public function setOcclusionMapTextureFile(File $occlusionMapTextureFile null)
  295.     {
  296.         $this->occlusionMapTextureFile $occlusionMapTextureFile;
  297.         // VERY IMPORTANT:
  298.         // It is required that at least one field changes if you are using Doctrine,
  299.         // otherwise the event listeners won't be called and the file is lost
  300.         if ($occlusionMapTextureFile) {
  301.             // if 'updatedAt' is not defined in your entity, use another property
  302.             $this->updatedAt = new \DateTime('now');
  303.         }
  304.     }
  305.     /**
  306.      * @return File
  307.      */
  308.     public function getOcclusionMapTextureFile()
  309.     {
  310.         return $this->occlusionMapTextureFile;
  311.     }
  312.     /**
  313.      * @return null|\DateTime
  314.      */
  315.     public function getUpdatedAt(): ?\DateTime
  316.     {
  317.         return $this->updatedAt;
  318.     }
  319.     /**
  320.      * @param \DateTime|null $updatedAt
  321.      * @return $this
  322.      */
  323.     public function setUpdatedAt(?\DateTime $updatedAt): static
  324.     {
  325.         $this->updatedAt $updatedAt;
  326.         return $this;
  327.     }
  328.     public function getPfosten(): ?Pfosten
  329.     {
  330.         return $this->pfosten;
  331.     }
  332.     public function setPfosten(?Pfosten $pfosten): self
  333.     {
  334.         $this->pfosten $pfosten;
  335.         return $this;
  336.     }
  337.     public function getAccessories(): ?Pfosten
  338.     {
  339.         return $this->accessories;
  340.     }
  341.     public function setAccessories(?Pfosten $accessories): self
  342.     {
  343.         $this->accessories $accessories;
  344.         return $this;
  345.     }
  346.     public function getZaunelement(): ?Zaunelement
  347.     {
  348.         return $this->zaunelement;
  349.     }
  350.     public function setZaunelement(?Zaunelement $zaunelement): self
  351.     {
  352.         $this->zaunelement $zaunelement;
  353.         return $this;
  354.     }
  355.     public function getTerrasse(): ?Terrasse
  356.     {
  357.         return $this->terrasse;
  358.     }
  359.     public function setTerrasse(?Terrasse $terrasse): self
  360.     {
  361.         $this->terrasse $terrasse;
  362.         return $this;
  363.     }
  364.     /**
  365.      * @return string
  366.      */
  367.     public function __toString(): string
  368.     {
  369.         return (string)$this->title;
  370.     }
  371.     public function getTextureTilingX(): ?float
  372.     {
  373.         return $this->textureTilingX;
  374.     }
  375.     public function setTextureTilingX(?float $textureTilingX): self
  376.     {
  377.         $this->textureTilingX $textureTilingX;
  378.         return $this;
  379.     }
  380.     public function getTextureTilingY(): ?float
  381.     {
  382.         return $this->textureTilingY;
  383.     }
  384.     public function setTextureTilingY(?float $textureTilingY): self
  385.     {
  386.         $this->textureTilingY $textureTilingY;
  387.         return $this;
  388.     }
  389.     public function getSmoothness(): ?float
  390.     {
  391.         return $this->smoothness;
  392.     }
  393.     public function setSmoothness(?float $smoothness): self
  394.     {
  395.         $this->smoothness $smoothness;
  396.         return $this;
  397.     }
  398.     public function getHeightMapIntensity(): ?float
  399.     {
  400.         return $this->heightMapIntensity;
  401.     }
  402.     public function setHeightMapIntensity(?float $heightMapIntensity): self
  403.     {
  404.         $this->heightMapIntensity $heightMapIntensity;
  405.         return $this;
  406.     }
  407.     public function getNormalMapIntensity(): ?float
  408.     {
  409.         return $this->normalMapIntensity;
  410.     }
  411.     public function setNormalMapIntensity(?float $normalMapIntensity): self
  412.     {
  413.         $this->normalMapIntensity $normalMapIntensity;
  414.         return $this;
  415.     }
  416.     public function getOcclusionMapIntensity(): ?float
  417.     {
  418.         return $this->occlusionMapIntensity;
  419.     }
  420.     public function setOcclusionMapIntensity(?float $occlusionMapIntensity): self
  421.     {
  422.         $this->occlusionMapIntensity $occlusionMapIntensity;
  423.         return $this;
  424.     }
  425.     public function getMetallicMapIntensity(): ?float
  426.     {
  427.         return $this->metallicMapIntensity;
  428.     }
  429.     public function setMetallicMapIntensity(?float $metallicMapIntensity): self
  430.     {
  431.         $this->metallicMapIntensity $metallicMapIntensity;
  432.         return $this;
  433.     }
  434. }