ILIAS  release_8 Revision v8.23
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  protected UploadResult $upload;
39 
40  public function __construct(
41  UploadResult $upload,
44  string $revision_title
45  ) {
46  $this->upload = $upload;
47  parent::__construct($next_version_number, $revision_owner_id, $revision_title);
48  $this->file_name = $upload->getName();
49  $this->suffix = pathinfo($this->file_name, PATHINFO_EXTENSION);
50  $this->mime_type = $upload->getMimeType();
51  $this->creation_date = new \DateTimeImmutable();
52  }
53 
54  public function getFileName(): string
55  {
56  return $this->file_name;
57  }
58 
59  public function getMimeType(): string
60  {
61  return $this->mime_type;
62  }
63 
64  public function getSuffix(): string
65  {
66  return $this->suffix;
67  }
68 
70  {
71  return $this->creation_date;
72  }
73 
74  public function getSize(): int
75  {
76  return $this->upload->getSize();
77  }
78 }
__construct(UploadResult $upload, int $next_version_number, int $revision_owner_id, string $revision_title)
__construct(Container $dic, ilPlugin $plugin)