ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Document\Properties Class Reference
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Document\Properties:

Public Member Functions

 __construct ()
 Create a new Document Properties instance. More...
 
 getCreator ()
 Get Creator. More...
 
 setCreator (string $creator)
 Set Creator. More...
 
 getLastModifiedBy ()
 Get Last Modified By. More...
 
 setLastModifiedBy (string $modifier)
 Set Last Modified By. More...
 
 getCreated ()
 Get Created. More...
 
 setCreated ($timestamp)
 Set Created. More...
 
 getModified ()
 Get Modified. More...
 
 setModified ($timestamp)
 Set Modified. More...
 
 getTitle ()
 Get Title. More...
 
 setTitle (string $title)
 Set Title. More...
 
 getDescription ()
 Get Description. More...
 
 setDescription (string $description)
 Set Description. More...
 
 getSubject ()
 Get Subject. More...
 
 setSubject (string $subject)
 Set Subject. More...
 
 getKeywords ()
 Get Keywords. More...
 
 setKeywords (string $keywords)
 Set Keywords. More...
 
 getCategory ()
 Get Category. More...
 
 setCategory (string $category)
 Set Category. More...
 
 getCompany ()
 Get Company. More...
 
 setCompany (string $company)
 Set Company. More...
 
 getManager ()
 Get Manager. More...
 
 setManager (string $manager)
 Set Manager. More...
 
 getCustomProperties ()
 Get a List of Custom Property Names. More...
 
 isCustomPropertySet (string $propertyName)
 Check if a Custom Property is defined. More...
 
 getCustomPropertyValue (string $propertyName)
 Get a Custom Property Value. More...
 
 getCustomPropertyType (string $propertyName)
 Get a Custom Property Type. More...
 
 setCustomProperty (string $propertyName, $propertyValue='', $propertyType=null)
 Set a Custom Property. More...
 

Static Public Member Functions

static convertProperty ($propertyValue, string $propertyType)
 Convert property to form desired by Excel. More...
 
static convertPropertyType (string $propertyType)
 

Data Fields

const PROPERTY_TYPE_BOOLEAN = 'b'
 constants More...
 
const PROPERTY_TYPE_INTEGER = 'i'
 
const PROPERTY_TYPE_FLOAT = 'f'
 
const PROPERTY_TYPE_DATE = 'd'
 
const PROPERTY_TYPE_STRING = 's'
 
const PROPERTY_TYPE_UNKNOWN = 'u'
 

Private Member Functions

 identifyPropertyType ($propertyValue)
 

Static Private Member Functions

static intOrFloatTimestamp ($timestamp)
 
static convertProperty2 ($propertyValue, string $type)
 Convert property to form desired by Excel. More...
 

Private Attributes

const VALID_PROPERTY_TYPE_LIST
 
 $creator = 'Unknown Creator'
 
 $lastModifiedBy
 
 $created
 
 $modified
 
 $title = 'Untitled Spreadsheet'
 
 $description = ''
 
 $subject = ''
 
 $keywords = ''
 
 $category = ''
 
 $manager = ''
 
 $company = ''
 
 $customProperties = []
 
const PROPERTY_TYPE_ARRAY
 
const SPECIAL_TYPES
 

Detailed Description

Definition at line 8 of file Properties.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Document\Properties::__construct ( )

Create a new Document Properties instance.

Definition at line 113 of file Properties.php.

114 {
115 // Initialise values
116 $this->lastModifiedBy = $this->creator;
117 $this->created = self::intOrFloatTimestamp(null);
118 $this->modified = self::intOrFloatTimestamp(null);
119 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$creator, and PhpOffice\PhpSpreadsheet\Document\Properties\intOrFloatTimestamp().

+ Here is the call graph for this function:

Member Function Documentation

◆ convertProperty()

static PhpOffice\PhpSpreadsheet\Document\Properties::convertProperty (   $propertyValue,
string  $propertyType 
)
static

Convert property to form desired by Excel.

Parameters
mixed$propertyValue
Returns
mixed

Definition at line 500 of file Properties.php.

501 {
502 return self::SPECIAL_TYPES[$propertyType] ?? self::convertProperty2($propertyValue, $propertyType);
503 }
static convertProperty2($propertyValue, string $type)
Convert property to form desired by Excel.
Definition: Properties.php:512

References PhpOffice\PhpSpreadsheet\Document\Properties\convertProperty2().

Referenced by PhpOffice\PhpSpreadsheet\Document\Properties\setCustomProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertProperty2()

static PhpOffice\PhpSpreadsheet\Document\Properties::convertProperty2 (   $propertyValue,
string  $type 
)
staticprivate

Convert property to form desired by Excel.

Parameters
mixed$propertyValue
Returns
mixed

Definition at line 512 of file Properties.php.

513 {
514 $propertyType = self::convertPropertyType($type);
515 switch ($propertyType) {
517 $intValue = (int) $propertyValue;
518
519 return ($type[0] === 'u') ? abs($intValue) : $intValue;
521 return (float) $propertyValue;
523 return self::intOrFloatTimestamp($propertyValue);
525 return is_bool($propertyValue) ? $propertyValue : ($propertyValue === 'true');
526 default: // includes string
527 return $propertyValue;
528 }
529 }
static convertPropertyType(string $propertyType)
Definition: Properties.php:531
$type

References $type, PhpOffice\PhpSpreadsheet\Document\Properties\convertPropertyType(), PhpOffice\PhpSpreadsheet\Document\Properties\intOrFloatTimestamp(), PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_BOOLEAN, PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_DATE, PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_FLOAT, and PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_INTEGER.

Referenced by PhpOffice\PhpSpreadsheet\Document\Properties\convertProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertPropertyType()

static PhpOffice\PhpSpreadsheet\Document\Properties::convertPropertyType ( string  $propertyType)
static

Definition at line 531 of file Properties.php.

531 : string
532 {
533 return self::PROPERTY_TYPE_ARRAY[$propertyType] ?? self::PROPERTY_TYPE_UNKNOWN;
534 }

References PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_UNKNOWN.

Referenced by PhpOffice\PhpSpreadsheet\Document\Properties\convertProperty2().

+ Here is the caller graph for this function:

◆ getCategory()

PhpOffice\PhpSpreadsheet\Document\Properties::getCategory ( )

Get Category.

Definition at line 313 of file Properties.php.

313 : string
314 {
315 return $this->category;
316 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$category.

◆ getCompany()

PhpOffice\PhpSpreadsheet\Document\Properties::getCompany ( )

Get Company.

Definition at line 333 of file Properties.php.

333 : string
334 {
335 return $this->company;
336 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$company.

◆ getCreated()

PhpOffice\PhpSpreadsheet\Document\Properties::getCreated ( )

Get Created.

Returns
float|int

Definition at line 187 of file Properties.php.

References PhpOffice\PhpSpreadsheet\Document\Properties\$created.

◆ getCreator()

PhpOffice\PhpSpreadsheet\Document\Properties::getCreator ( )

Get Creator.

Definition at line 124 of file Properties.php.

124 : string
125 {
126 return $this->creator;
127 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$creator.

◆ getCustomProperties()

PhpOffice\PhpSpreadsheet\Document\Properties::getCustomProperties ( )

Get a List of Custom Property Names.

Returns
string[]

Definition at line 375 of file Properties.php.

375 : array
376 {
377 return array_keys($this->customProperties);
378 }

◆ getCustomPropertyType()

PhpOffice\PhpSpreadsheet\Document\Properties::getCustomPropertyType ( string  $propertyName)

Get a Custom Property Type.

Returns
null|string

Definition at line 407 of file Properties.php.

408 {
409 return $this->customProperties[$propertyName]['type'] ?? null;
410 }

◆ getCustomPropertyValue()

PhpOffice\PhpSpreadsheet\Document\Properties::getCustomPropertyValue ( string  $propertyName)

Get a Custom Property Value.

Returns
mixed

Definition at line 393 of file Properties.php.

394 {
395 if (isset($this->customProperties[$propertyName])) {
396 return $this->customProperties[$propertyName]['value'];
397 }
398
399 return null;
400 }

◆ getDescription()

PhpOffice\PhpSpreadsheet\Document\Properties::getDescription ( )

Get Description.

Definition at line 253 of file Properties.php.

253 : string
254 {
255 return $this->description;
256 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$description.

◆ getKeywords()

PhpOffice\PhpSpreadsheet\Document\Properties::getKeywords ( )

Get Keywords.

Definition at line 293 of file Properties.php.

293 : string
294 {
295 return $this->keywords;
296 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$keywords.

◆ getLastModifiedBy()

PhpOffice\PhpSpreadsheet\Document\Properties::getLastModifiedBy ( )

Get Last Modified By.

Definition at line 144 of file Properties.php.

144 : string
145 {
147 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$lastModifiedBy.

◆ getManager()

PhpOffice\PhpSpreadsheet\Document\Properties::getManager ( )

Get Manager.

Definition at line 353 of file Properties.php.

353 : string
354 {
355 return $this->manager;
356 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$manager.

◆ getModified()

PhpOffice\PhpSpreadsheet\Document\Properties::getModified ( )

Get Modified.

Returns
float|int

Definition at line 211 of file Properties.php.

References PhpOffice\PhpSpreadsheet\Document\Properties\$modified.

◆ getSubject()

PhpOffice\PhpSpreadsheet\Document\Properties::getSubject ( )

Get Subject.

Definition at line 273 of file Properties.php.

273 : string
274 {
275 return $this->subject;
276 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$subject.

◆ getTitle()

PhpOffice\PhpSpreadsheet\Document\Properties::getTitle ( )

Get Title.

Definition at line 233 of file Properties.php.

233 : string
234 {
235 return $this->title;
236 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$title.

◆ identifyPropertyType()

PhpOffice\PhpSpreadsheet\Document\Properties::identifyPropertyType (   $propertyValue)
private
Parameters
mixed$propertyValue

Definition at line 415 of file Properties.php.

415 : string
416 {
417 if (is_float($propertyValue)) {
419 }
420 if (is_int($propertyValue)) {
422 }
423 if (is_bool($propertyValue)) {
425 }
426
428 }

References PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_BOOLEAN, PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_FLOAT, PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_INTEGER, and PhpOffice\PhpSpreadsheet\Document\Properties\PROPERTY_TYPE_STRING.

Referenced by PhpOffice\PhpSpreadsheet\Document\Properties\setCustomProperty().

+ Here is the caller graph for this function:

◆ intOrFloatTimestamp()

static PhpOffice\PhpSpreadsheet\Document\Properties::intOrFloatTimestamp (   $timestamp)
staticprivate
Parameters
null | float | int | string$timestamp
Returns
float|int

Definition at line 166 of file Properties.php.

167 {
168 if ($timestamp === null) {
169 $timestamp = (float) (new DateTime())->format('U');
170 } elseif (is_string($timestamp)) {
171 if (is_numeric($timestamp)) {
172 $timestamp = (float) $timestamp;
173 } else {
174 $timestamp = preg_replace('/[.][0-9]*$/', '', $timestamp) ?? '';
175 $timestamp = (float) (new DateTime($timestamp))->format('U');
176 }
177 }
178
180 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
static evaluate($value)
Help some functions with large results operate correctly on 32-bit, by returning result as int when p...
Definition: IntOrFloat.php:15

References $timestamp, and PhpOffice\PhpSpreadsheet\Shared\IntOrFloat\evaluate().

Referenced by PhpOffice\PhpSpreadsheet\Document\Properties\__construct(), PhpOffice\PhpSpreadsheet\Document\Properties\convertProperty2(), PhpOffice\PhpSpreadsheet\Document\Properties\setCreated(), and PhpOffice\PhpSpreadsheet\Document\Properties\setModified().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCustomPropertySet()

PhpOffice\PhpSpreadsheet\Document\Properties::isCustomPropertySet ( string  $propertyName)

Check if a Custom Property is defined.

Definition at line 383 of file Properties.php.

383 : bool
384 {
385 return array_key_exists($propertyName, $this->customProperties);
386 }

◆ setCategory()

PhpOffice\PhpSpreadsheet\Document\Properties::setCategory ( string  $category)

Set Category.

Returns
$this

Definition at line 323 of file Properties.php.

323 : self
324 {
325 $this->category = $category;
326
327 return $this;
328 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$category.

◆ setCompany()

PhpOffice\PhpSpreadsheet\Document\Properties::setCompany ( string  $company)

Set Company.

Returns
$this

Definition at line 343 of file Properties.php.

343 : self
344 {
345 $this->company = $company;
346
347 return $this;
348 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$company.

◆ setCreated()

PhpOffice\PhpSpreadsheet\Document\Properties::setCreated (   $timestamp)

Set Created.

Parameters
null | float | int | string$timestamp
Returns
$this

Definition at line 199 of file Properties.php.

199 : self
200 {
201 $this->created = self::intOrFloatTimestamp($timestamp);
202
203 return $this;
204 }

References $timestamp, and PhpOffice\PhpSpreadsheet\Document\Properties\intOrFloatTimestamp().

+ Here is the call graph for this function:

◆ setCreator()

PhpOffice\PhpSpreadsheet\Document\Properties::setCreator ( string  $creator)

Set Creator.

Returns
$this

Definition at line 134 of file Properties.php.

134 : self
135 {
136 $this->creator = $creator;
137
138 return $this;
139 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$creator.

◆ setCustomProperty()

PhpOffice\PhpSpreadsheet\Document\Properties::setCustomProperty ( string  $propertyName,
  $propertyValue = '',
  $propertyType = null 
)

Set a Custom Property.

Parameters
mixed$propertyValue
string$propertyType'i' : Integer 'f' : Floating Point 's' : String 'd' : Date/Time 'b' : Boolean
Returns
$this

Definition at line 443 of file Properties.php.

443 : self
444 {
445 if (($propertyType === null) || (!in_array($propertyType, self::VALID_PROPERTY_TYPE_LIST))) {
446 $propertyType = $this->identifyPropertyType($propertyValue);
447 }
448
449 if (!is_object($propertyValue)) {
450 $this->customProperties[$propertyName] = [
451 'value' => self::convertProperty($propertyValue, $propertyType),
452 'type' => $propertyType,
453 ];
454 }
455
456 return $this;
457 }
static convertProperty($propertyValue, string $propertyType)
Convert property to form desired by Excel.
Definition: Properties.php:500

References PhpOffice\PhpSpreadsheet\Document\Properties\convertProperty(), and PhpOffice\PhpSpreadsheet\Document\Properties\identifyPropertyType().

+ Here is the call graph for this function:

◆ setDescription()

PhpOffice\PhpSpreadsheet\Document\Properties::setDescription ( string  $description)

Set Description.

Returns
$this

Definition at line 263 of file Properties.php.

263 : self
264 {
265 $this->description = $description;
266
267 return $this;
268 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$description.

◆ setKeywords()

PhpOffice\PhpSpreadsheet\Document\Properties::setKeywords ( string  $keywords)

Set Keywords.

Returns
$this

Definition at line 303 of file Properties.php.

303 : self
304 {
305 $this->keywords = $keywords;
306
307 return $this;
308 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$keywords.

◆ setLastModifiedBy()

PhpOffice\PhpSpreadsheet\Document\Properties::setLastModifiedBy ( string  $modifier)

Set Last Modified By.

Returns
$this

Definition at line 154 of file Properties.php.

154 : self
155 {
156 $this->lastModifiedBy = $modifier;
157
158 return $this;
159 }

◆ setManager()

PhpOffice\PhpSpreadsheet\Document\Properties::setManager ( string  $manager)

Set Manager.

Returns
$this

Definition at line 363 of file Properties.php.

363 : self
364 {
365 $this->manager = $manager;
366
367 return $this;
368 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$manager.

◆ setModified()

PhpOffice\PhpSpreadsheet\Document\Properties::setModified (   $timestamp)

Set Modified.

Parameters
null | float | int | string$timestamp
Returns
$this

Definition at line 223 of file Properties.php.

223 : self
224 {
225 $this->modified = self::intOrFloatTimestamp($timestamp);
226
227 return $this;
228 }

References $timestamp, and PhpOffice\PhpSpreadsheet\Document\Properties\intOrFloatTimestamp().

+ Here is the call graph for this function:

◆ setSubject()

PhpOffice\PhpSpreadsheet\Document\Properties::setSubject ( string  $subject)

Set Subject.

Returns
$this

Definition at line 283 of file Properties.php.

283 : self
284 {
285 $this->subject = $subject;
286
287 return $this;
288 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$subject.

◆ setTitle()

PhpOffice\PhpSpreadsheet\Document\Properties::setTitle ( string  $title)

Set Title.

Returns
$this

Definition at line 243 of file Properties.php.

243 : self
244 {
245 $this->title = $title;
246
247 return $this;
248 }

References PhpOffice\PhpSpreadsheet\Document\Properties\$title.

Field Documentation

◆ $category

PhpOffice\PhpSpreadsheet\Document\Properties::$category = ''
private

◆ $company

PhpOffice\PhpSpreadsheet\Document\Properties::$company = ''
private

◆ $created

PhpOffice\PhpSpreadsheet\Document\Properties::$created
private

◆ $creator

PhpOffice\PhpSpreadsheet\Document\Properties::$creator = 'Unknown Creator'
private

◆ $customProperties

PhpOffice\PhpSpreadsheet\Document\Properties::$customProperties = []
private

Definition at line 108 of file Properties.php.

◆ $description

PhpOffice\PhpSpreadsheet\Document\Properties::$description = ''
private

◆ $keywords

PhpOffice\PhpSpreadsheet\Document\Properties::$keywords = ''
private

◆ $lastModifiedBy

PhpOffice\PhpSpreadsheet\Document\Properties::$lastModifiedBy
private

◆ $manager

PhpOffice\PhpSpreadsheet\Document\Properties::$manager = ''
private

◆ $modified

PhpOffice\PhpSpreadsheet\Document\Properties::$modified
private

◆ $subject

PhpOffice\PhpSpreadsheet\Document\Properties::$subject = ''
private

◆ $title

PhpOffice\PhpSpreadsheet\Document\Properties::$title = 'Untitled Spreadsheet'
private

◆ PROPERTY_TYPE_ARRAY

◆ PROPERTY_TYPE_BOOLEAN

◆ PROPERTY_TYPE_DATE

◆ PROPERTY_TYPE_FLOAT

◆ PROPERTY_TYPE_INTEGER

◆ PROPERTY_TYPE_STRING

const PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING = 's'

◆ PROPERTY_TYPE_UNKNOWN

const PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_UNKNOWN = 'u'

◆ SPECIAL_TYPES

const PhpOffice\PhpSpreadsheet\Document\Properties::SPECIAL_TYPES
private
Initial value:
= [
'empty' => '',
'null' => null,
]

Definition at line 488 of file Properties.php.

◆ VALID_PROPERTY_TYPE_LIST

const PhpOffice\PhpSpreadsheet\Document\Properties::VALID_PROPERTY_TYPE_LIST
private

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