ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilRenderedImage Class Reference

Represents an image that was created from a preview renderer and that can be further processed to create the preview. More...

+ Collaboration diagram for ilRenderedImage:

Public Member Functions

 __construct ($img_path, $is_temporary=true)
 Constructor. More...
 
 getImagePath ()
 Gets the absolute path to the rendered image. More...
 
 isTemporary ()
 Defines whether the image is temporary and can be deleted after the preview was created. More...
 
 delete ()
 Deletes the image file if it is temporary. More...
 

Private Attributes

 $img_path = null
 
 $is_temporary = true
 

Detailed Description

Represents an image that was created from a preview renderer and that can be further processed to create the preview.

Author
Stefan Born stefa.nosp@m.n.bo.nosp@m.rn@ph.nosp@m.zh.c.nosp@m.h
Version
$Id$

Definition at line 15 of file class.ilRenderedImage.php.

Constructor & Destructor Documentation

◆ __construct()

ilRenderedImage::__construct (   $img_path,
  $is_temporary = true 
)

Constructor.

Parameters
string$img_pathThe absolute path to the image.
bool$is_temporaryDefines whether the image is temporary and can be deleted after the preview was created.

Definition at line 36 of file class.ilRenderedImage.php.

References $img_path, and $is_temporary.

37  {
38  $this->img_path = $img_path;
39  $this->is_temporary = $is_temporary;
40  }

Member Function Documentation

◆ delete()

ilRenderedImage::delete ( )

Deletes the image file if it is temporary.

Definition at line 65 of file class.ilRenderedImage.php.

References getImagePath(), and isTemporary().

66  {
67  // only delete if not temporary
68  if ($this->isTemporary() && is_file($this->getImagePath()))
69  {
70  @unlink($this->getImagePath());
71  }
72  }
isTemporary()
Defines whether the image is temporary and can be deleted after the preview was created.
getImagePath()
Gets the absolute path to the rendered image.
+ Here is the call graph for this function:

◆ getImagePath()

ilRenderedImage::getImagePath ( )

Gets the absolute path to the rendered image.

Returns
string The absolute path to the rendered image.

Definition at line 47 of file class.ilRenderedImage.php.

References $img_path.

Referenced by delete().

48  {
49  return $this->img_path;
50  }
+ Here is the caller graph for this function:

◆ isTemporary()

ilRenderedImage::isTemporary ( )

Defines whether the image is temporary and can be deleted after the preview was created.

Returns
bool true, if the image is temporary and can be deleted after the preview was created; otherwise, false.

Definition at line 57 of file class.ilRenderedImage.php.

References $is_temporary.

Referenced by delete().

58  {
59  return $this->is_temporary;
60  }
+ Here is the caller graph for this function:

Field Documentation

◆ $img_path

ilRenderedImage::$img_path = null
private

Definition at line 21 of file class.ilRenderedImage.php.

Referenced by __construct(), and getImagePath().

◆ $is_temporary

ilRenderedImage::$is_temporary = true
private

Definition at line 28 of file class.ilRenderedImage.php.

Referenced by __construct(), and isTemporary().


The documentation for this class was generated from the following file: