ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
UploadResult.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\FileUpload\DTO;
20
22use ILIAS\FileUpload\ScalarTypeCheckAware;
23
36final class UploadResult
37{
38 use ScalarTypeCheckAware;
39 private string $name;
40 private int $size;
41 private string $mimeType;
42 private string $path;
43
44
58 public function __construct(string $name, int $size, string $mimeType, private ImmutableStringMap $metaData, private ProcessingStatus $status, string $path)
59 {
60 $this->stringTypeCheck($name, "name");
61 $this->stringTypeCheck($mimeType, "mimeType");
62 $this->stringTypeCheck($path, "path");
63 $this->intTypeCheck($size, "size");
64
65 $this->name = $name;
66 $this->size = $size;
67 $this->mimeType = $mimeType;
68 $this->path = $path;
69 }
70
71
75 public function getName(): string
76 {
77 return $this->name;
78 }
79
80
84 public function getSize(): int
85 {
86 return $this->size;
87 }
88
89
93 public function getMimeType(): string
94 {
95 return $this->mimeType;
96 }
97
98
103 {
104 return $this->metaData;
105 }
106
107
111 public function getStatus(): ProcessingStatus
112 {
113 return $this->status;
114 }
115
116
117 public function isOK(): bool
118 {
119 return $this->status->getCode() === ProcessingStatus::OK;
120 }
121
122
126 public function getPath(): string
127 {
128 return $this->path;
129 }
130}
__construct(string $name, int $size, string $mimeType, private ImmutableStringMap $metaData, private ProcessingStatus $status, string $path)
UploadResult constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Metadata.php:19