ILIAS  release_8 Revision v8.24
BasicFileInfoResult.php
Go to the documentation of this file.
1<?php
2
20
22
28final class BasicFileInfoResult implements FileInfoResult
29{
30 private string $mime_type;
31 private string $file_identifier;
32 private int $size;
33 private string $name;
35
39 public function __construct(
41 string $file_identifier,
42 string $name,
43 int $size,
44 string $mime_type
45 ) {
46 $this->file_identification_key = $file_identification_key;
47 $this->file_identifier = $file_identifier;
48 $this->name = $name;
49 $this->size = $size;
50 $this->mime_type = $mime_type;
51 }
52
53
54 public function getFileIdentifier(): string
55 {
57 }
58
59
60 public function getName(): string
61 {
62 return $this->name;
63 }
64
65
66 public function getSize(): int
67 {
68 return $this->size;
69 }
70
71
72 public function getMimeType(): string
73 {
74 return $this->mime_type;
75 }
76
77
81 final public function jsonSerialize(): array
82 {
83 $str = $this->file_identification_key ?? UploadHandler::DEFAULT_FILE_ID_PARAMETER;
84
85 return [
86 'name' => $this->name,
87 'size' => $this->size,
88 'mime_type' => $this->mime_type,
90 ];
91 }
92}
__construct(string $file_identification_key, string $file_identifier, string $name, int $size, string $mime_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...