ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
FilePayload.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 {
28  public function __construct(
29  private string $uri,
30  private string $mime_type,
31  private string $file_name,
32  private string $disposition,
33  private int $user_id = 0
34  ) {
36  'p' => $uri,
37  'm' => $mime_type,
38  'n' => $file_name,
39  'd' => $disposition,
40  'u' => $user_id,
41  ]);
42  }
43 
44  public static function fromArray(array $raw_payload): self
45  {
46  return new self(
47  $raw_payload['p'],
48  $raw_payload['m'],
49  $raw_payload['n'],
50  $raw_payload['d'],
51  $raw_payload['u']
52  );
53  }
54 
55  public function getUri(): string
56  {
57  return $this->uri;
58  }
59 
60  public function getMimeType(): string
61  {
62  return $this->mime_type;
63  }
64 
65  public function getFileName(): string
66  {
67  return $this->file_name;
68  }
69 
70  public function getDisposition(): string
71  {
72  return $this->disposition;
73  }
74 
75  public function getUserId(): int
76  {
77  return $this->user_id;
78  }
79 }
__construct(private string $uri, private string $mime_type, private string $file_name, private string $disposition, private int $user_id=0)
Definition: FilePayload.php:28
__construct(Container $dic, ilPlugin $plugin)