src/Entity/Zaunelement.php line 16
<?phpnamespace App\Entity;use App\Entity\ZaunelementMaterials;use App\Repository\ZaunelementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Symfony\Component\Serializer\Annotation\Groups;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\Entity(repositoryClass: ZaunelementRepository::class)]#[Vich\Uploadable]class Zaunelement{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(type: "integer")]#[Groups(["products"])]private $id;#[ORM\OneToOne(targetEntity: Pfosten::class, inversedBy: "zaunelement", cascade: ["persist", "remove"])]#[Groups(["products"])]private $recommendedPfosten;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $length;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $heightLeft;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $heightRight;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $depth;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $model;#[Vich\UploadableField(mapping: "models", fileNameProperty: "model")]private $modelFile;#[ORM\Column(type: "datetime", nullable: true)]#[Groups(["products"])]private $updatedAt;#[ORM\ManyToMany(targetEntity: "Material", inversedBy: "zaunelement")]#[ORM\JoinTable(name: "zaunelement_material")]private $compatibleMaterial;#[ORM\ManyToOne(targetEntity: Material::class, cascade: ["persist"])]#[ORM\JoinColumn(name: "default_material_id", referencedColumnName: "id")]#[Groups(["products"])]private $defaultMaterial;#[ORM\ManyToMany(targetEntity: Pfosten::class, mappedBy: "compatibleZaunelemente")]private $pfostens;#[ORM\ManyToMany(targetEntity: "Product", mappedBy: "zaunelemente")]private $product;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $title;#[ORM\Column(type: "string", length: 2048, nullable: true)]#[Groups(["products"])]private $shortDescription;#[ORM\Column(type: "string", length: 2048, nullable: true)]#[Groups(["products"])]private $longDescription;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $thumbnail;#[Vich\UploadableField(mapping: "product_images", fileNameProperty: "thumbnail")]private $thumbnailFile;#[ORM\Column(type: "boolean", nullable: true)]#[Groups(["products"])]private $beta;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $adBanner;#[Vich\UploadableField(mapping: "product_images", fileNameProperty: "adBanner")]private $adBannerFile;#[ORM\Column(type: "string", length: 2048, nullable: true)]#[Groups(["products"])]private $adBannerText;#[ORM\ManyToMany(targetEntity: Accessories::class, inversedBy: "zaunelements")]#[Groups(["products"])]private $accessories;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $price;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $articleNumber;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $element;#[ORM\Column(type: "integer", nullable: true)]#[Groups(["products"])]private $MinCustomSize;#[ORM\Column(type: "integer", nullable: true)]#[Groups(["products"])]private $MaxCustomSize;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $seller_price;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $fixing_distance;#[ORM\OneToMany(targetEntity: ZaunelementMaterials::class, mappedBy: "zaunelement_id", cascade: ["persist", "remove"])]#[Groups(["products"])]private $zaunelementMaterials;#[ORM\ManyToOne(targetEntity: ZaunelementMaterials::class, inversedBy: "zaunelement")]#[Groups(["products"])]private $defaultMaterialCombination;#[ORM\Column(type: "array", nullable: true)]#[Groups(["products"])]private $default_accessory_id = [];#[ORM\Column(type: "array", nullable: true)]#[Groups(["products"])]private $current_accessory_id = [];#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $min_anker_x;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $min_anker_y;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $max_anker_x;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $max_anker_y;public function __construct(){$this->compatibleMaterial = new ArrayCollection();$this->pfostens = new ArrayCollection();$this->accessories = new ArrayCollection();$this->zaunelementMaterials = new ArrayCollection();}public function __toString(){return $this->title ?? '';}public function getId(): ?int{return $this->id;}public function getRecommendedPfosten(): ?Pfosten{return $this->recommendedPfosten;}public function setRecommendedPfosten(?Pfosten $recommendedPfosten): self{$this->recommendedPfosten = $recommendedPfosten;return $this;}public function getLength(): ?float{return $this->length;}public function setLength(?float $length): self{$this->length = $length;return $this;}public function getHeightLeft(): ?float{return $this->heightLeft;}public function setHeightLeft(?float $heightLeft): self{$this->heightLeft = $heightLeft;return $this;}public function getHeightRight(): ?float{return $this->heightRight;}public function setHeightRight(?float $heightRight): self{$this->heightRight = $heightRight;return $this;}public function getDepth(): ?float{return $this->depth;}public function setDepth(?float $depth): self{$this->depth = $depth;return $this;}public function getModel(): ?string{return $this->model;}public function setModel(?string $model): self{$this->model = $model;return $this;}/*** @param File|null $model*/public function setModelFile(File $model = null){$this->modelFile = $model;// VERY IMPORTANT:// It is required that at least one field changes if you are using Doctrine,// otherwise the event listeners won't be called and the file is lostif ($model) {// if 'updatedAt' is not defined in your entity, use another property$this->updatedAt = new \DateTime('now');}}/*** @return File*/public function getModelFile(){return $this->modelFile;}/*** @return null|\DateTime*/public function getUpdatedAt(): ?\DateTime{return $this->updatedAt;}/*** @param \DateTime|null $updatedAt* @return $this*/public function setUpdatedAt(?\DateTime $updatedAt): static{$this->updatedAt = $updatedAt;return $this;}/*** @return Collection|Material[]*/public function getCompatibleMaterial(): Collection|array{return $this->compatibleMaterial;}public function addCompatibleMaterial(Material $compatibleMaterial): self{if (!$this->compatibleMaterial->contains($compatibleMaterial)) {$this->compatibleMaterial[] = $compatibleMaterial;$compatibleMaterial->setZaunelement($this);}return $this;}public function removeCompatibleMaterial(Material $compatibleMaterial): self{if ($this->compatibleMaterial->removeElement($compatibleMaterial)) {// set the owning side to null (unless already changed)if ($compatibleMaterial->getZaunelement() === $this) {$compatibleMaterial->setZaunelement(null);}}return $this;}public function getDefaultMaterial(): ?Material{return $this->defaultMaterial;}public function setDefaultMaterial(?Material $defaultMaterial): self{$this->defaultMaterial = $defaultMaterial;return $this;}/*** @return Collection|Pfosten[]*/public function getPfostens(): Collection|array{return $this->pfostens;}public function addPfosten(Pfosten $pfosten): self{if (!$this->pfostens->contains($pfosten)) {$this->pfostens[] = $pfosten;$pfosten->addCompatibleZaunelemente($this);}return $this;}public function removePfosten(Pfosten $pfosten): self{if ($this->pfostens->removeElement($pfosten)) {$pfosten->removeCompatibleZaunelemente($this);}return $this;}public function getProduct(): ?Product{return $this->product;}public function setProduct(?Product $product): void{$this->product->clear();$this->product = new ArrayCollection($product);}/*** Add a product in the category.** @param $product Product The product to associate*/public function addProduct(Product $product){if ($this->product->contains($product)) {return;}$this->product->add($product);$product->addZaunelemente($this);}/*** @param Product $product*/public function removeProduct(Product $product){if (!$this->product->contains($product)) {return;}$this->product->removeElement($product);$product->removeZaunelemente($this);}public function getTitle(): ?string{return $this->title;}public function setTitle(?string $title): self{$this->title = $title;return $this;}public function getShortDescription(): ?string{return $this->shortDescription;}public function setShortDescription(?string $shortDescription): self{$this->shortDescription = $shortDescription;return $this;}public function getLongDescription(): ?string{return $this->longDescription;}public function setLongDescription(?string $longDescription): self{$this->longDescription = $longDescription;return $this;}public function getThumbnail(): ?string{return $this->thumbnail;}public function setThumbnail(?string $thumbnail): self{$this->thumbnail = $thumbnail;return $this;}public function getBeta(): ?bool{return $this->beta;}public function setBeta(?bool $beta): self{$this->beta = $beta;return $this;}public function getAdBanner(): ?string{return $this->adBanner;}public function setAdBanner(?string $adBanner): self{$this->adBanner = $adBanner;return $this;}/*** @param null|File $image*/public function setAdBannerFile(File $image = null){$this->adBannerFile = $image;// VERY IMPORTANT:// It is required that at least one field changes if you are using Doctrine,// otherwise the event listeners won't be called and the file is lostif ($image) {// if 'updatedAt' is not defined in your entity, use another property$this->updatedAt = new \DateTime('now');}}/*** @return null|File*/public function getAdBannerFile(): ?File{return $this->adBannerFile;}public function getAdBannerText(): ?string{return $this->adBannerText;}public function setAdBannerText(?string $adBannerText): self{$this->adBannerText = $adBannerText;return $this;}/*** @param null|File $image*/public function setThumbnailFile(File $image = null){$this->thumbnailFile = $image;// VERY IMPORTANT:// It is required that at least one field changes if you are using Doctrine,// otherwise the event listeners won't be called and the file is lostif ($image) {// if 'updatedAt' is not defined in your entity, use another property$this->updatedAt = new \DateTime('now');}}/*** @return null|File*/public function getThumbnailFile(): ?File{return $this->thumbnailFile;}/*** @return Collection|Accessories[]*/public function getAccessories(): Collection|array{return $this->accessories;}public function addAccessory(Accessories $accessory): self{if (!$this->accessories->contains($accessory)) {$this->accessories[] = $accessory;}return $this;}public function removeAccessory(Accessories $accessory): self{$this->accessories->removeElement($accessory);return $this;}public function getPrice(): ?float{return $this->price;}public function setPrice(?float $price): self{$this->price = $price;return $this;}public function getArticleNumber(): ?string{return $this->articleNumber;}public function setArticleNumber(?string $articleNumber): self{$this->articleNumber = $articleNumber;return $this;}public function getElement(): ?string{return $this->element;}public function setElement(?string $element): self{$this->element = $element;return $this;}public function getMinCustomSize(): ?int{return $this->MinCustomSize;}public function setMinCustomSize(?int $MinCustomSize): self{$this->MinCustomSize = $MinCustomSize;return $this;}public function getMaxCustomSize(): ?int{return $this->MaxCustomSize;}public function setMaxCustomSize(?int $MaxCustomSize): self{$this->MaxCustomSize = $MaxCustomSize;return $this;}public function getSellerPrice(): ?float{return $this->seller_price;}public function setSellerPrice(?float $seller_price): self{$this->seller_price = $seller_price;return $this;}public function getFixingDistance(): ?float{return $this->fixing_distance;}public function setFixingDistance(?float $fixing_distance): self{$this->fixing_distance = $fixing_distance;return $this;}/*** @return Collection|ZaunelementMaterials[]*/public function getZaunelementMaterials(): Collection|array{return $this->zaunelementMaterials;}public function addZaunelementMaterial(ZaunelementMaterials $zaunelementMaterial): self{if (!$this->zaunelementMaterials->contains($zaunelementMaterial)) {$this->zaunelementMaterials[] = $zaunelementMaterial;$zaunelementMaterial->setZaunelementId($this);}return $this;}public function removeZaunelementMaterial(ZaunelementMaterials $zaunelementMaterial): self{if ($this->zaunelementMaterials->removeElement($zaunelementMaterial)) {// set the owning side to null (unless already changed)if ($zaunelementMaterial->getZaunelementId() === $this) {$zaunelementMaterial->setZaunelementId(null);}}return $this;}public function getDefaultMaterialCombination(): ?ZaunelementMaterials{return $this->defaultMaterialCombination;}public function setDefaultMaterialCombination(?ZaunelementMaterials $defaultMaterialCombination): self{$this->defaultMaterialCombination = $defaultMaterialCombination;return $this;}public function getDefaultAccessoryId(): ?array{return $this->default_accessory_id;}public function setDefaultAccessoryId(?array $default_accessory_id): self{$this->default_accessory_id = $default_accessory_id;return $this;}public function getCurrentAccessoryId(): ?array{return $this->current_accessory_id;}public function setCurrentAccessoryId(?array $current_accessory_id): self{$this->current_accessory_id = $current_accessory_id;return $this;}public function getMinAnkerX(): ?float{return $this->min_anker_x;}public function setMinAnkerX(?float $min_anker_x): self{$this->min_anker_x = $min_anker_x;return $this;}public function getMinAnkerY(): ?float{return $this->min_anker_y;}public function setMinAnkerY(?float $min_anker_y): self{$this->min_anker_y = $min_anker_y;return $this;}public function getMaxAnkerX(): ?float{return $this->max_anker_x;}public function setMaxAnkerX(?float $max_anker_x): self{$this->max_anker_x = $max_anker_x;return $this;}public function getMaxAnkerY(): ?float{return $this->max_anker_y;}public function setMaxAnkerY(?float $max_anker_y): self{$this->max_anker_y = $max_anker_y;return $this;}}