ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
BasicFileInfoResult.php
Go to the documentation of this file.
1<?php
2
20
22
28final class BasicFileInfoResult implements FileInfoResult
29{
33 public function __construct(private string $file_identification_key, private string $file_identifier, private string $name, private int $size, private string $mime_type)
34 {
35 }
36
37
38 public function getFileIdentifier(): string
39 {
40 return $this->file_identifier;
41 }
42
43
44 public function getName(): string
45 {
46 return $this->name;
47 }
48
49
50 public function getSize(): int
51 {
52 return $this->size;
53 }
54
55
56 public function getMimeType(): string
57 {
58 return $this->mime_type;
59 }
60
61
65 final public function jsonSerialize(): array
66 {
67 $str = $this->file_identification_key ?? UploadHandler::DEFAULT_FILE_ID_PARAMETER;
68
69 return [
70 'name' => $this->name,
71 'size' => $this->size,
72 'mime_type' => $this->mime_type,
73 $str => $this->file_identifier,
74 ];
75 }
76}
__construct(private string $file_identification_key, private string $file_identifier, private string $name, private int $size, private string $mime_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...