src/Entity/Pfosten.php line 15
<?phpnamespace App\Entity;use App\Repository\PfostenRepository;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: PfostenRepository::class)]#[Vich\Uploadable]class Pfosten{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(type: "integer")]#[Groups(["products"])]private $id;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $width;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $height;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $length;#[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 ?\DateTime $updatedAt;#[ORM\OneToOne(mappedBy: "recommendedPfosten", targetEntity: Zaunelement::class, cascade: ["persist", "remove"])]private $zaunelement;#[ORM\ManyToMany(targetEntity: Material::class, inversedBy: "pfosten")]#[ORM\JoinTable(name: "pfosten_material")]private $compatibleMaterial;#[ORM\ManyToOne(targetEntity: Material::class, cascade: ["persist"])]#[ORM\JoinColumn(name: "default_material_id", referencedColumnName: "id")]private $defaultMaterial;#[ORM\ManyToMany(targetEntity: Zaunelement::class, inversedBy: "pfostens")]#[Groups(["products"])]private $compatibleZaunelemente;#[ORM\ManyToMany(targetEntity: Product::class, mappedBy: "pfosten")]private $product;#[ORM\Column(type: "string", length: 2048, nullable: true)]#[Groups(["products"])]private $shortDescription;#[ORM\Column(type: "string", length: 2048, nullable: true)]#[Groups(["products"])]private $description;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $title;#[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: "pfostens")]#[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 $fixation_type;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $material_type;#[ORM\Column(type: "string", length: 255, nullable: true)]#[Groups(["products"])]private $type;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $seller_price;#[ORM\OneToMany(mappedBy: "pfosten_id", targetEntity: PfostenMaterials::class, cascade: ["persist", "remove"])]#[Groups(["products"])]private $pfostenMaterials;#[ORM\ManyToOne(targetEntity: PfostenMaterials::class, inversedBy: "pfostens")]#[Groups(["products"])]private $defaultMaterialCombination;#[ORM\Column(type: "array", nullable: true)]#[Groups(["products"])]private $default_accessory_id = [];#[ORM\Column(type: "integer", nullable: true)]#[Groups(["products"])]private $mounting_angle;#[ORM\Column(type: "array", nullable: true)]#[Groups(["products"])]private $current_accessory_id = [];public function __construct(){$this->compatibleMaterial = new ArrayCollection();$this->compatibleZaunelemente = new ArrayCollection();$this->accessories = new ArrayCollection();$this->pfostenMaterials = new ArrayCollection();}/*** @return mixed*/public function __toString(){return $this->title ?? '';}public function getId(): ?int{return $this->id;}public function getWidth(): ?float{return $this->width;}public function setWidth(?float $width): self{$this->width = $width;return $this;}public function getHeight(): ?float{return $this->height;}public function setHeight(?float $height): self{$this->height = $height;return $this;}public function getLength(): ?float{return $this->length;}public function setLength(?float $length): self{$this->length = $length;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;}public function getZaunelement(): ?Zaunelement{return $this->zaunelement;}public function setZaunelement(?Zaunelement $zaunelement): self{// unset the owning side of the relation if necessaryif ($zaunelement === null && $this->zaunelement !== null) {$this->zaunelement->setRecommendedPfosten(null);}// set the owning side of the relation if necessaryif ($zaunelement !== null && $zaunelement->getRecommendedPfosten() !== $this) {$zaunelement->setRecommendedPfosten($this);}$this->zaunelement = $zaunelement;return $this;}/*** @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->setPfosten($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->getPfosten() === $this) {$compatibleMaterial->setPfosten(null);}}return $this;}public function getDefaultMaterial(): ?Material{return $this->defaultMaterial;}public function setDefaultMaterial(?Material $defaultMaterial): self{$this->defaultMaterial = $defaultMaterial;return $this;}/*** @return Collection|Zaunelement[]*/public function getCompatibleZaunelemente(): Collection|array{return $this->compatibleZaunelemente;}public function addCompatibleZaunelemente(Zaunelement $compatibleZaunelemente): self{if (!$this->compatibleZaunelemente->contains($compatibleZaunelemente)) {$this->compatibleZaunelemente[] = $compatibleZaunelemente;}return $this;}public function removeCompatibleZaunelemente(Zaunelement $compatibleZaunelemente): self{$this->compatibleZaunelemente->removeElement($compatibleZaunelemente);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){if ($this->product->contains($product)) {return;}$this->product->add($product);$product->addPfosten($this);}/*** @param Product $product*/public function removeProduct($product){if (!$this->product->contains($product)) {return;}$this->product->removeElement($product);$product->removePfosten($this);}public function getShortDescription(): ?string{return $this->shortDescription;}public function setShortDescription(?string $shortDescription): self{$this->shortDescription = $shortDescription;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getTitle(): ?string{return $this->title;}public function setTitle(?string $title): self{$this->title = $title;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;}public function getAdBannerText(): ?string{return $this->adBannerText;}public function setAdBannerText(?string $adBannerText): self{$this->adBannerText = $adBannerText;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;}/*** @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 getFixationType(): ?string{return $this->fixation_type;}public function setFixationType(?string $fixation_type): self{$this->fixation_type = $fixation_type;return $this;}public function getMaterialType(): ?string{return $this->material_type;}public function setMaterialType(?string $material_type): self{$this->material_type = $material_type;return $this;}public function getType(): ?string{return $this->type;}public function setType(?string $type): self{$this->type = $type;return $this;}public function getSellerPrice(): ?float{return $this->seller_price;}public function setSellerPrice(?float $seller_price): self{$this->seller_price = $seller_price;return $this;}/*** @return Collection|PfostenMaterials []*/public function getPfostenMaterials(): Collection|PfostenMaterials{return $this->pfostenMaterials;}public function addPfostenMaterial(PfostenMaterials $pfostenMaterial): self{if (!$this->pfostenMaterials->contains($pfostenMaterial)) {$this->pfostenMaterials[] = $pfostenMaterial;$pfostenMaterial->setPfostenId($this);}return $this;}public function removePfostenMaterial(PfostenMaterials $pfostenMaterial): self{if ($this->pfostenMaterials->removeElement($pfostenMaterial)) {// set the owning side to null (unless already changed)if ($pfostenMaterial->getPfostenId() === $this) {$pfostenMaterial->setPfostenId(null);}}return $this;}public function getDefaultMaterialCombination(): ?PfostenMaterials{return $this->defaultMaterialCombination;}public function setDefaultMaterialCombination(?PfostenMaterials $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 getMountingAngle(): ?int{return $this->mounting_angle;}public function setMountingAngle(?int $mounting_angle): self{$this->mounting_angle = $mounting_angle;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;}}