src/Entity/Terrasse.php line 15
<?phpnamespace App\Entity;use App\Repository\TerrasseRepository;use Symfony\Component\HttpFoundation\File\File;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\Entity(repositoryClass: TerrasseRepository::class)]#[Vich\Uploadable]class Terrasse{#[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\ManyToMany(targetEntity: "Product", mappedBy: "terrassen")]private $product;#[ORM\ManyToOne(targetEntity: Material::class, cascade: ["persist"])]#[ORM\JoinColumn(name: "default_material_id", referencedColumnName: "id")]#[Groups(["products"])]private $defaultMaterial;#[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\Column(type: "string", length: 255)]#[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;#[ORM\ManyToMany(targetEntity: "Material", inversedBy: "terrasse")]#[ORM\JoinTable(name: "terrasse_material")]#[Groups(["products"])]private $compatibleMaterial;#[ORM\ManyToMany(targetEntity: Accessories::class, inversedBy: "terrasses")]#[Groups(["products"])]private $accessories;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $price;#[ORM\Column(type: "string", length: 255, nullable: true)]private $articleNumber;#[ORM\Column(type: "float", nullable: true)]#[Groups(["products"])]private $seller_price;public function __construct(){$this->compatibleMaterial = new ArrayCollection();$this->accessories = new ArrayCollection();}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 getProduct(): ?Collection{return $this->product;}public function setProduct(?Product $product): self{$this->product->clear();$this->product = new ArrayCollection($product);return $this;}/*** 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->addTerrassen($this);}/*** @param Product $product*/public function removeProduct($product){if (!$this->product->contains($product)) {return;}$this->product->removeElement($product);$product->removeTerrassen($this);}public function getDefaultMaterial(): ?Material{return $this->defaultMaterial;}public function setDefaultMaterial(?Material $defaultMaterial): self{$this->defaultMaterial = $defaultMaterial;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 \DateTime*/public function getUpdatedAt(): \DateTime{return $this->updatedAt;}/*** @param \DateTime|null $updatedAt* @return $this*/public function setUpdatedAt(?\DateTime $updatedAt): static{$this->updatedAt = $updatedAt;if(!$updatedAt) {$this->updatedAt = new \DateTime();}return $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;}/*** @return string*/public function __toString(): string{return (string)$this->title ?? '';}/*** @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;}return $this;}public function removeCompatibleMaterial(Material $compatibleMaterial): self{$this->compatibleMaterial->removeElement($compatibleMaterial);return $this;}/*** @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 getSellerPrice(): ?float{return $this->seller_price;}public function setSellerPrice(?float $seller_price): self{$this->seller_price = $seller_price;return $this;}}