ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjFileInfo.php
Go to the documentation of this file.
1 <?php
2 
27 
32 {
34 
35  private string $title;
36  protected string $file_name;
37  protected string $suffix;
38  protected bool $deliver_inline;
39  protected bool $download_directly;
40  protected int $version;
42  protected bool $is_zip;
43  protected string $mime_type;
44  protected DataSize $file_size;
45  protected ?int $page_count;
46 
47  public function __construct(
48  string $title,
49  string $file_name,
50  string $suffix,
51  bool $deliver_inline,
52  bool $download_directly,
53  int $version,
54  DateTimeImmutable $creation_date,
55  bool $is_zip,
56  string $mime_type,
57  DataSize $file_size,
58  ?int $page_count
59  ) {
60  $this->title = $title;
61  $this->file_name = $file_name;
62  $this->suffix = $suffix;
63  $this->deliver_inline = $deliver_inline;
64  $this->download_directly = $download_directly;
65  $this->version = $version;
66  $this->creation_date = $creation_date;
67  $this->is_zip = $is_zip;
68  $this->mime_type = $mime_type;
69  $this->file_size = $file_size;
70  $this->page_count = $page_count;
71  }
72 
73  public function getFileName(): string
74  {
75  return $this->file_name;
76  }
77 
78  public function getListTitle(): string
79  {
80  return $this->stripSuffix($this->title, $this->getSuffix());
81  }
82 
83  public function getHeaderTitle(): string
84  {
85  return $this->ensureSuffix($this->title, $this->getSuffix());
86  }
87 
88  public function getSuffix(): string
89  {
90  return $this->suffix;
91  }
92 
93  public function shouldDeliverInline(): bool
94  {
95  return $this->deliver_inline;
96  }
97 
98  public function shouldDownloadDirectly(): bool
99  {
101  }
102 
103  public function getVersion(): int
104  {
105  return $this->version;
106  }
107 
109  {
110  return $this->creation_date;
111  }
112 
113  public function isZip(): bool
114  {
115  return $this->is_zip;
116  }
117 
118  public function getMimeType(): string
119  {
120  return $this->mime_type;
121  }
122 
123  public function getFileSize(): DataSize
124  {
125  return $this->file_size;
126  }
127 
128  public function getPageCount(): ?int
129  {
130  return $this->page_count;
131  }
132 
133 }
This class provides the data size with additional information to remove the work to calculate the siz...
Definition: DataSize.php:30
DateTimeImmutable $creation_date
stripSuffix(string $title, ?string $suffix=null)
trait ilObjFileSecureString
Trait ilObjFileSecureString.
__construct(string $title, 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)
ensureSuffix(string $title, ?string $suffix=null)