ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
UploadInfoResolver.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 
4 
7 
14 {
18  protected $upload;
22  protected $path;
26  protected $file_name;
30  protected $suffix;
34  protected $mime_type;
38  protected $creation_date;
39 
40  public function __construct(
44  string $revision_title
45  ) {
46  parent::__construct($next_version_number, $revision_owner_id, $revision_title);
47  $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  {
71  return $this->creation_date;
72  }
73 
74  public function getSize() : int
75  {
76  return $this->upload->getSize() ?? 0;
77  }
78 }
__construct(UploadResult $upload, int $next_version_number, int $revision_owner_id, string $revision_title)
__construct(Container $dic, ilPlugin $plugin)