ILIAS  release_8 Revision v8.24
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.

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

References $certificatePath, and $fileService.

Member Function Documentation

◆ deleteBackgroundImage()

ilCertificateBackgroundImageDelete::deleteBackgroundImage ( ?int  $version)

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

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 }
$version
Definition: plugin.php:24
$filename
Definition: buildRTE.php:78

References $filename, and $version.

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: