ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
BasicHandlerResult.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
7 /******************************************************************************
8  *
9  * This file is part of ILIAS, a powerful learning management system.
10  *
11  * ILIAS is licensed with the GPL-3.0, you should have received a copy
12  * of said license along with the source code.
13  *
14  * If this is not the case or you just want to try ILIAS, you'll find
15  * us at:
16  * https://www.ilias.de
17  * https://github.com/ILIAS-eLearning
18  *
19  *****************************************************************************/
25 final class BasicHandlerResult implements HandlerResult
26 {
27  private string $file_identification_key;
28  private int $status;
29  private string $file_identifier;
30  private string $message;
31 
32 
36  public function __construct(
37  string $file_identification_key,
38  int $status,
39  string $file_identifier,
40  string $message
41  ) {
42  $this->file_identification_key = $file_identification_key;
43  $this->status = $status;
44  $this->file_identifier = $file_identifier;
45  $this->message = $message;
46  }
47 
48 
52  public function getStatus(): int
53  {
54  return $this->status;
55  }
56 
57 
61  public function getFileIdentifier(): string
62  {
64  }
65 
66 
70  final public function jsonSerialize(): array
71  {
72  $str = $this->file_identification_key ?? UploadHandler::DEFAULT_FILE_ID_PARAMETER;
73 
74  return [
75  'status' => $this->status,
76  'message' => $this->message,
77  $str => $this->file_identifier,
78  ];
79  }
80 
81 
85  public function getMessage(): string
86  {
87  return $this->message;
88  }
89 }
__construct(string $file_identification_key, int $status, string $file_identifier, string $message)
BasicHandlerResult constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...