ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
UploadInfoResolver.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
32 {
33  protected string $path;
34  protected string $file_name;
35  protected string $suffix;
36  protected string $mime_type;
37  protected \DateTimeImmutable $creation_date;
38 
39  public function __construct(
40  protected UploadResult $upload,
41  int $next_version_number,
42  int $revision_owner_id,
43  string $revision_title
44  ) {
45  parent::__construct($next_version_number, $revision_owner_id, $revision_title);
46  $this->file_name = $this->upload->getName();
47  $this->suffix = pathinfo($this->file_name, PATHINFO_EXTENSION);
48  $this->mime_type = $this->upload->getMimeType();
49  $this->creation_date = new \DateTimeImmutable();
50  }
51 
52  public function getFileName(): string
53  {
54  return $this->file_name;
55  }
56 
57  public function getMimeType(): string
58  {
59  return $this->mime_type;
60  }
61 
62  public function getSuffix(): string
63  {
64  return $this->suffix;
65  }
66 
68  {
69  return $this->creation_date;
70  }
71 
72  public function getSize(): int
73  {
74  return $this->upload->getSize();
75  }
76 }
__construct(protected UploadResult $upload, int $next_version_number, int $revision_owner_id, string $revision_title)
__construct(Container $dic, ilPlugin $plugin)