<?php
namespace App\Entity;
use App\Repository\PipelineMajWebAttachmentRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @Vich\Uploadable
*/
#[ORM\Entity(repositoryClass: PipelineMajWebAttachmentRepository::class)]
class PipelineMajWebAttachment
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: PipelineMajWebMessage::class, inversedBy: 'attachments')]
#[ORM\JoinColumn(nullable: false)]
private ?PipelineMajWebMessage $message = null;
#[ORM\Column(type: 'string', nullable: true)]
private ?string $fileName = null;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $fileSize = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTime $updatedAt = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $originalName = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $mimeType = null;
/**
* @Vich\UploadableField(mapping="pipeline_maj_web", fileNameProperty="fileName", size="fileSize")
*/
private ?File $file = null;
public function getId(): ?int { return $this->id; }
public function getMessage(): ?PipelineMajWebMessage { return $this->message; }
public function setMessage(?PipelineMajWebMessage $message): self { $this->message = $message; return $this; }
public function getFileName(): ?string { return $this->fileName; }
public function setFileName(?string $fileName): self { $this->fileName = $fileName; return $this; }
public function getFileSize(): ?int { return $this->fileSize; }
public function setFileSize(?int $fileSize): self { $this->fileSize = $fileSize; return $this; }
public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; }
public function setFile(?File $file = null): void
{
$this->file = $file;
if ($file !== null) {
$this->updatedAt = new \DateTime();
}
}
public function getFile(): ?File { return $this->file; }
public function getOriginalName(): ?string { return $this->originalName; }
public function setOriginalName(?string $originalName): self { $this->originalName = $originalName; return $this; }
public function getMimeType(): ?string { return $this->mimeType; }
public function setMimeType(?string $mimeType): self { $this->mimeType = $mimeType; return $this; }
}