ILIAS  release_7 Revision v7.30-3-g800a261c036
BasicFileInfoResult.php
Go to the documentation of this file.
1<?php
2
4
6
13{
14
18 private $mime_type;
26 private $size;
30 private $name;
35
36
46 public function __construct(string $file_identification_key, string $file_identifier, string $name, int $size, string $mime_type)
47 {
48 $this->file_identification_key = $file_identification_key;
49 $this->file_identifier = $file_identifier;
50 $this->name = $name;
51 $this->size = $size;
52 $this->mime_type = $mime_type;
53 }
54
55
56 public function getFileIdentifier() : string
57 {
59 }
60
61
62 public function getName() : string
63 {
64 return $this->name;
65 }
66
67
68 public function getSize() : int
69 {
70 return $this->size;
71 }
72
73
74 public function getMimeType() : string
75 {
76 return $this->mime_type;
77 }
78
79
83 final public function jsonSerialize()
84 {
85 $str = $this->file_identification_key ?? UploadHandler::DEFAULT_FILE_ID_PARAMETER;
86
87 return [
88 'name' => $this->name,
89 'size' => $this->size,
90 'mime_type' => $this->mime_type,
92 ];
93 }
94}
An exception for terminatinating execution or to throw for unit testing.
__construct(string $file_identification_key, string $file_identifier, string $name, int $size, string $mime_type)
BasicFileInfoResult constructor.