'\\d+'], security: 'is_granted("ROLE_FILE")', processor: UploadRequestProcessor::class ) ] )] class UploadRequest { /** * @var int | null */ #[ApiProperty(identifier: true)] private ?int $fileId = null; /** * Le nom du fichier * @var string */ private string $filename; /** * Le contenu du fichier uploadé encodé au format Base64 * @var string */ private string $content; /** * Si vrai, le propriétaire du fichier ne sera pas l'utilisateur en cours, mais l'organisation à laquelle il * appartient. * @var bool */ private bool $organizationOwned = false; /** * Le type de fichier uploadé, si connu * @var string */ #[Assert\Choice(callback: [FileTypeEnum::class, 'toArray'])] private string $type = "NONE"; /** * Visibilité du fichier * @var string */ private string $visibility = 'NOBODY'; /** * Type mime (il sera déduit automatiquement du nom du fichier s'il n'est pas fourni ici) * @var string|null */ private ?string $mimeType = null; /** * Configuration du fichier (par exemple le cropping d'une image) * @var string */ private ?string $config = null; public function __construct() { $this->type = FileTypeEnum::NONE()->getValue(); } /** * @return int */ public function getFileId() : int { return $this->fileId; } /** * @param int $id * @return self */ public function setFileId(int $id) : self { $this->fileId = $id; return $this; } /** * @return string */ public function getContent(): string { return $this->content; } /** * @param string $content * @return void */ public function setContent(string $content): void { $this->content = $content; } /** * @return bool */ public function isOrganizationOwned(): bool { return $this->organizationOwned; } /** * @param bool $organizationOwned * @return self */ public function setOrganizationOwned(bool $organizationOwned): self { $this->organizationOwned = $organizationOwned; return $this; } /** * @return string */ public function getFilename(): string { return $this->filename; } /** * @param string $filename * @return self */ public function setFilename(string $filename): self { $this->filename = $filename; return $this; } /** * @return string */ public function getType(): string { return $this->type; } /** * @param string $type * @return self */ public function setType(string $type): self { $this->type = $type; return $this; } /** * @return string */ public function getVisibility(): string { return $this->visibility; } /** * @param string $visibility * @return self */ public function setVisibility(string $visibility): self { $this->visibility = $visibility; return $this; } /** * @return string|null */ public function getMimeType(): ?string { return $this->mimeType; } /** * @param string|null $mimeType * @return self */ public function setMimeType(?string $mimeType): self { $this->mimeType = $mimeType; return $this; } /** * @return string|null */ public function getConfig(): ?string { return $this->config; } /** * @param string|null $config * @return self */ public function setConfig(?string $config): self { $this->config = $config; return $this; } }