ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilCertificateBackgroundImageDelete Class Reference
+ Collaboration diagram for ilCertificateBackgroundImageDelete:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

29  {
30  }

Member Function Documentation

◆ deleteBackgroundImage()

ilCertificateBackgroundImageDelete::deleteBackgroundImage ( ?int  $version)

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

References $filename.

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

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