ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Drawing.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
PhpOffice\PhpSpreadsheet\Worksheet
;
4
5
use
PhpOffice\PhpSpreadsheet\Exception
as
PhpSpreadsheetException
;
6
7
class
Drawing
extends
BaseDrawing
8
{
14
private
$path
;
15
19
public
function
__construct
()
20
{
21
// Initialise values
22
$this->path =
''
;
23
24
// Initialize parent
25
parent::__construct();
26
}
27
33
public
function
getFilename
()
34
{
35
return
basename($this->path);
36
}
37
43
public
function
getIndexedFilename
()
44
{
45
$fileName = $this->
getFilename
();
46
$fileName = str_replace(
' '
,
'_'
, $fileName);
47
48
return
str_replace(
'.'
. $this->
getExtension
(),
''
, $fileName) . $this->
getImageIndex
() .
'.'
. $this->
getExtension
();
49
}
50
56
public
function
getExtension
()
57
{
58
$exploded = explode(
'.'
, basename($this->path));
59
60
return
$exploded[count($exploded) - 1];
61
}
62
68
public
function
getPath
()
69
{
70
return
$this->path
;
71
}
72
81
public
function
setPath
($pValue, $pVerifyFile =
true
)
82
{
83
if
($pVerifyFile) {
84
if
(file_exists($pValue)) {
85
$this->path = $pValue;
86
87
if
($this->width == 0 && $this->height == 0) {
88
// Get width/height
89
[$this->width, $this->height] = getimagesize($pValue);
90
}
91
}
else
{
92
throw
new
PhpSpreadsheetException
(
"File $pValue not found!"
);
93
}
94
}
else
{
95
$this->path = $pValue;
96
}
97
98
return
$this;
99
}
100
106
public
function
getHashCode
()
107
{
108
return
md5(
109
$this->path .
110
parent::getHashCode() .
111
__CLASS__
112
);
113
}
114
}
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\$path
$path
Definition:
Drawing.php:14
$path
$path
Definition:
aliased.php:25
PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing
Definition:
BaseDrawing.php:9
PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing\getImageIndex
getImageIndex()
Get image index.
Definition:
BaseDrawing.php:137
PhpOffice\PhpSpreadsheet\Worksheet
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\getHashCode
getHashCode()
Get hash code.
Definition:
Drawing.php:106
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\setPath
setPath($pValue, $pVerifyFile=true)
Set Path.
Definition:
Drawing.php:81
PhpOffice\PhpSpreadsheet\Shared\Drawing
Definition:
Drawing.php:7
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\getFilename
getFilename()
Get Filename.
Definition:
Drawing.php:33
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\__construct
__construct()
Create a new Drawing.
Definition:
Drawing.php:19
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\getIndexedFilename
getIndexedFilename()
Get indexed filename (using image index).
Definition:
Drawing.php:43
Exception
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\getExtension
getExtension()
Get Extension.
Definition:
Drawing.php:56
php
PhpOffice\PhpSpreadsheet\Worksheet\Drawing\getPath
getPath()
Get Path.
Definition:
Drawing.php:68
libs
composer
vendor
phpoffice
phpspreadsheet
src
PhpSpreadsheet
Worksheet
Drawing.php
Generated on Thu Jan 16 2025 19:01:47 for ILIAS by
1.8.13 (using
Doxyfile
)