Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
716cf56cb2.url-de-test.ws
/
htdocs_old
/
src
/
Entity
/
/srv/data/web/vhosts/716cf56cb2.url-de-test.ws/htdocs_old/src/Entity/PublicWelcomed.php
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation as Vich; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\HttpFoundation\File\UploadedFile; /** * @ORM\Entity(repositoryClass="App\Repository\PublicWelcomedRepository") * @UniqueEntity("value") * @Vich\Uploadable */ class PublicWelcomed { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $value; /** * NOTE: This is not a mapped field of entity metadata, just a simple property. * * @Vich\UploadableField(mapping="images", fileNameProperty="imageName") * @Assert\Image( * maxWidth = 2000, * minWidth = 400, * minHeight = 400, * ) * @Assert\File(mimeTypes = {"image/jpg", "image/jpeg"}) * * @var File */ private $imageFile; /** * @ORM\Column(type="string", length=255, nullable=true) * * @var string */ private $imageName; /** * @ORM\Column(type="string", length=255) */ private $imageDesc; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime") */ private $updatedAt; /** * @ORM\ManyToMany(targetEntity="App\Entity\Establishment", mappedBy="publics") */ private $establishments; /** * @ORM\OneToOne(targetEntity="App\Entity\Page", inversedBy="publicWelcomed", cascade={"persist", "remove"}) */ private $page; public function __construct() { $this->establishments = new ArrayCollection(); $this->createdAt = new \DateTime(); $this->updatedAt = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getValue(): ?string { return $this->value; } public function setValue(string $value): self { $this->value = $value; return $this; } public function __toString() { return $this->value; } public function getImageName(): ?string { return $this->imageName; } public function setImageName(?string $imageName): void { $this->imageName = $imageName; } /** * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $imageFile * */ public function setimageFile(?File $imageFile = null): void { $this->imageFile = $imageFile; if (null !== $imageFile) { // 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 lost $this->updatedAt = new \DateTimeImmutable(); } } public function getImageFile(): ?File { return $this->imageFile; } public function getImageDesc(): ?string { return $this->imageDesc; } public function setImageDesc(string $imageDesc): self { $this->imageDesc = $imageDesc; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @return Collection|Establishment[] */ public function getEstablishments(): Collection { return $this->establishments; } public function addEstablishment(Establishment $establishment): self { if (!$this->establishments->contains($establishment)) { $this->establishments[] = $establishment; $establishment->addPublic($this); } return $this; } public function removeEstablishment(Establishment $establishment): self { if ($this->establishments->contains($establishment)) { $this->establishments->removeElement($establishment); $establishment->removePublic($this); } return $this; } public function getPage(): ?Page { return $this->page; } public function setPage(?Page $page): self { $this->page = $page; return $this; } }