1 | <?php |
||
25 | class ByHashUploadFileCommand |
||
26 | { |
||
27 | /** |
||
28 | * The file id. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | private $id; |
||
33 | |||
34 | /** |
||
35 | * The file name. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | private $name; |
||
40 | |||
41 | /** |
||
42 | * The real content of file. |
||
43 | * |
||
44 | * @var mixed |
||
45 | */ |
||
46 | private $uploadedFile; |
||
47 | |||
48 | /** |
||
49 | * The file mime type. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | private $mimeType; |
||
54 | |||
55 | /** |
||
56 | * Constructor. |
||
57 | * |
||
58 | * @param string $aName The file name |
||
59 | * @param mixed $anUploadedFile The real content of file |
||
60 | * @param string $aMimeType The file mime type |
||
61 | * @param string|null $anId The file id |
||
62 | * |
||
63 | * @throws FileNameInvalidException when the mime type given is null |
||
64 | * @throws FileMimeTypeDoesNotSupportException when the name given is null |
||
65 | */ |
||
66 | public function __construct($aName, $anUploadedFile, $aMimeType, $anId = null) |
||
82 | |||
83 | /** |
||
84 | * Gets the file id. |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function id() |
||
92 | |||
93 | /** |
||
94 | * Gets the file name. |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public function name() |
||
102 | |||
103 | /** |
||
104 | * Gets the mime type. |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | public function mimeType() |
||
112 | |||
113 | /** |
||
114 | * Gets the real content of file. |
||
115 | * |
||
116 | * @return mixed |
||
117 | */ |
||
118 | public function uploadedFile() |
||
122 | } |
||
123 |