ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjFileInfo.php
Go to the documentation of this file.
1 <?php
2 
28 
33 {
35 
37  protected string $title;
38  protected string $file_name;
39  protected string $suffix;
40  protected bool $deliver_inline;
41  protected bool $download_directly;
42  protected int $version;
44  protected bool $is_zip;
45  protected string $mime_type;
46  protected DataSize $file_size;
47  protected ?int $page_count;
48 
49  public function __construct(
50  string $title,
52  string $file_name,
53  string $suffix,
54  bool $deliver_inline,
55  bool $download_directly,
56  int $version,
57  DateTimeImmutable $creation_date,
58  bool $is_zip,
59  string $mime_type,
60  DataSize $file_size,
61  ?int $page_count
62  ) {
63  $this->title = $title;
64  $this->rid = $rid;
65  $this->file_name = $file_name;
66  $this->suffix = $suffix;
67  $this->deliver_inline = $deliver_inline;
68  $this->download_directly = $download_directly;
69  $this->version = $version;
70  $this->creation_date = $creation_date;
71  $this->is_zip = $is_zip;
72  $this->mime_type = $mime_type;
73  $this->file_size = $file_size;
74  $this->page_count = $page_count;
75  }
76 
77  public function getFileName(): string
78  {
79  return $this->file_name;
80  }
81 
82  public function getListTitle(): string
83  {
84  return $this->stripSuffix($this->title, $this->getSuffix());
85  }
86 
87  public function getHeaderTitle(): string
88  {
89  return $this->stripSuffix($this->title, $this->getSuffix());
90  }
91 
92  public function getSuffix(): string
93  {
94  return $this->suffix;
95  }
96 
97  public function getRID(): ?ResourceIdentification
98  {
99  return $this->rid;
100  }
101 
102  public function shouldDeliverInline(): bool
103  {
104  return $this->deliver_inline;
105  }
106 
107  public function shouldDownloadDirectly(): bool
108  {
110  }
111 
112  public function getVersion(): int
113  {
114  return $this->version;
115  }
116 
118  {
119  return $this->creation_date;
120  }
121 
122  public function isZip(): bool
123  {
124  return $this->is_zip;
125  }
126 
127  public function getMimeType(): string
128  {
129  return $this->mime_type;
130  }
131 
132  public function getFileSize(): DataSize
133  {
134  return $this->file_size;
135  }
136 
137  public function getPageCount(): ?int
138  {
139  return $this->page_count;
140  }
141 
142 }
__construct(string $title, ?ResourceIdentification $rid, string $file_name, string $suffix, bool $deliver_inline, bool $download_directly, int $version, DateTimeImmutable $creation_date, bool $is_zip, string $mime_type, DataSize $file_size, ?int $page_count)
This class provides the data size with additional information to remove the work to calculate the siz...
Definition: DataSize.php:30
DateTimeImmutable $creation_date
ResourceIdentification $rid
stripSuffix(string $title, ?string $suffix=null)
trait ilObjFileSecureString
Trait ilObjFileSecureString.