src/Entity/Fap.php line 15
<?phpnamespace App\Entity;use App\Repository\FapRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Symfony\Component\HttpFoundation\File\UploadedFile;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: FapRepository::class)]#[Vich\Uploadable]class Fap{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]private ?string $picture = null;#[Vich\UploadableField(mapping: 'fap', fileNameProperty: 'picture')]#[Assert\File(maxSize: '2048k',extensions: ['jpg','jpeg','png'],extensionsMessage: 'Please upload a valid Image',)]private ?File $pictureFile = null;#[ORM\Column(length: 255)]private ?string $bnbAddress = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private \DateTimeInterface $createdAt;#[ORM\Column]private bool $validated = false;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $updatedAt = null;public function __construct(){$this->createdAt = new \DateTime();$this->updatedAt = new \DateTime();}public function getId(): ?int{return $this->id;}public function getPicture(): ?string{return $this->picture;}public function setPicture(?string $picture): self{$this->picture = $picture;return $this;}public function getBnbAddress(): ?string{return $this->bnbAddress;}public function setBnbAddress(string $bnbAddress): self{$this->bnbAddress = $bnbAddress;return $this;}public function getCreatedAt(): ?\DateTimeInterface{return $this->createdAt;}public function setCreatedAt(\DateTimeInterface $createdAt): self{$this->createdAt = $createdAt;return $this;}public function isValidated(): ?bool{return $this->validated;}public function setValidated(bool $validated): self{$this->validated = $validated;return $this;}/*** If manually uploading a file (i.e. not using Symfony Form) ensure an instance* of 'UploadedFile' is injected into this setter to trigger the update. If this* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter* must be able to accept an instance of 'File' as the bundle will inject one here* during Doctrine hydration.** @param File|UploadedFile|null $pictureFile*/public function setPictureFile(?File $pictureFile = null): void{$this->pictureFile = $pictureFile;if (null !== $pictureFile) {// 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 getPictureFile(): ?File{return $this->pictureFile;}public function getUpdatedAt(): ?\DateTimeInterface{return $this->updatedAt;}public function setUpdatedAt(?\DateTimeInterface $updatedAt): self{$this->updatedAt = $updatedAt;return $this;}}