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/News.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\NewsRepository") * @Vich\Uploadable */ class News { /** * @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="news_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 $title; /** * @ORM\Column(type="text") * @Assert\NotBlank(message="Le descriptif du poste ne peut pas ĂȘtre vide!") * @Assert\Length(min=10) */ private $content; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime") */ private $updatedAt; 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 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; } 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; } }