ILIAS  release_8 Revision v8.24
UploadInfoResolver.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use DateTimeImmutable;
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;
39
40 public function __construct(
44 string $revision_title
45 ) {
46 $this->upload = $upload;
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
69 public function getCreationDate(): DateTimeImmutable
70 {
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)
@inheritDoc