ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilRenderedImage.php
Go to the documentation of this file.
1 <?php
28 {
32  private ?string $img_path = null;
33 
38  private bool $is_temporary = true;
39 
46  public function __construct(string $img_path, bool $is_temporary = true)
47  {
48  $this->img_path = $img_path;
49  $this->is_temporary = $is_temporary;
50  }
51 
57  public function getImagePath(): ?string
58  {
59  return $this->img_path;
60  }
61 
67  public function isTemporary(): bool
68  {
69  return $this->is_temporary;
70  }
71 
75  public function delete(): void
76  {
77  // only delete if not temporary
78  if ($this->isTemporary() && is_file($this->getImagePath())) {
79  @unlink($this->getImagePath());
80  }
81  }
82 }
bool $is_temporary
Defines whether the image is temporary and can be deleted after the preview was created from the imag...
isTemporary()
Defines whether the image is temporary and can be deleted after the preview was created.
__construct(string $img_path, bool $is_temporary=true)
Constructor.
getImagePath()
Gets the absolute path to the rendered image.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $img_path
The absolute path to the image.