ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCertificateBackgroundImageDelete Class Reference
+ Collaboration diagram for ilCertificateBackgroundImageDelete:

Public Member Functions

 __construct (string $certificatePath, ilCertificateBackgroundImageFileService $fileService)
 
 deleteBackgroundImage (?int $version)
 

Private Attributes

string $certificatePath
 
ilCertificateBackgroundImageFileService $fileService
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificateBackgroundImageDelete::__construct ( string  $certificatePath,
ilCertificateBackgroundImageFileService  $fileService 
)

Definition at line 29 of file classs.ilCertificateBackgroundImageDelete.php.

References $certificatePath, and $fileService.

30  {
31  $this->certificatePath = $certificatePath;
32  $this->fileService = $fileService;
33  }
ilCertificateBackgroundImageFileService $fileService

Member Function Documentation

◆ deleteBackgroundImage()

ilCertificateBackgroundImageDelete::deleteBackgroundImage ( ?int  $version)

Definition at line 35 of file classs.ilCertificateBackgroundImageDelete.php.

References $filename.

35  : void
36  {
37  if (is_file($this->fileService->getBackgroundImageThumbPath())) {
38  unlink($this->fileService->getBackgroundImageThumbPath());
39  }
40 
41  $version_string = '';
42  if (is_int($version) && $version >= 0) {
43  $version_string = (string) $version;
44  }
45 
46  $filename = $this->certificatePath . 'background_' . $version_string . '.jpg';
47  if (is_file($filename)) {
48  unlink($filename);
49  }
50 
51  foreach ($this->fileService->getValidBackgroundImageFileExtensions() as $extension) {
52  if (file_exists($this->fileService->getBackgroundImageTempfilePath($extension))) {
53  unlink($this->fileService->getBackgroundImageTempfilePath($extension));
54  }
55  }
56  }
$filename
Definition: buildRTE.php:78
$version
Definition: plugin.php:24

Field Documentation

◆ $certificatePath

string ilCertificateBackgroundImageDelete::$certificatePath
private

Definition at line 26 of file classs.ilCertificateBackgroundImageDelete.php.

Referenced by __construct().

◆ $fileService

ilCertificateBackgroundImageFileService ilCertificateBackgroundImageDelete::$fileService
private

Definition at line 27 of file classs.ilCertificateBackgroundImageDelete.php.

Referenced by __construct().


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