Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
trash
/
vhost_www.bachtale.com_1719306535
/
htdocs
/
src
/
Entity
/
/srv/data/trash/vhost_www.bachtale.com_1719306535/htdocs/src/Entity/PageBlock.php
<?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; 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\PageBlockRepository") * @Vich\Uploadable */ class PageBlock { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * NOTE: This is not a mapped field of entity metadata, just a simple property. * * @Vich\UploadableField(mapping="page_pdf", fileNameProperty="pdfName") * @Assert\File( * maxSize = "2048k", * mimeTypes = {"application/pdf", "application/x-pdf"}, * mimeTypesMessage = "Veuillez télécharger un PDF valide" * ) * @var File|null */ private $pdfFile; /** * @ORM\Column(type="string", length=255, nullable=true) * * @var string|null */ private $pdfName; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $pdfTitle; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $title; /** * @ORM\Column(type="text") */ private $content; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $moreTitle; /** * @ORM\Column(type="text", nullable=true) */ private $moreContent; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime") */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity="App\Entity\Page", inversedBy="pageBlocks") */ private $page; public function __construct() { $this->createdAt = new \DateTime(); $this->updatedAt = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): self { $this->content = $content; return $this; } public function getMoreTitle(): ?string { return $this->moreTitle; } public function setMoreTitle(?string $moreTitle): self { $this->moreTitle = $moreTitle; return $this; } public function getMoreContent(): ?string { return $this->moreContent; } public function setMoreContent(?string $moreContent): self { $this->moreContent = $moreContent; 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; } /** * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $imageFile * */ public function setPdfFile(?File $pdfFile = null): void { $this->pdfFile = $pdfFile; if (null !== $pdfFile) { // 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 getPdfFile(): ?File { return $this->pdfFile; } public function setPdfName(?string $pdfName): void { $this->pdfName = $pdfName; } public function getPdfName(): ?string { return $this->pdfName; } public function getPdfTitle(): ?string { return $this->pdfTitle; } public function setPdfTitle(string $pdfTitle): self { $this->pdfTitle = $pdfTitle; return $this; } public function getPage(): ?Page { return $this->page; } public function setPage(?Page $page): self { $this->page = $page; return $this; } }