> */ private $customProperties = []; /** * Create a new \PhpOffice\PhpPresentation\DocumentProperties */ public function __construct() { // Initialise values $this->creator = 'Unknown Creator'; $this->lastModifiedBy = $this->creator; $this->created = \time(); $this->modified = \time(); $this->title = 'Untitled Presentation'; $this->subject = ''; $this->description = ''; $this->keywords = ''; $this->category = ''; $this->company = 'Microsoft Corporation'; } /** * Get Creator. * * @return string */ public function getCreator() { return $this->creator; } /** * Set Creator. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setCreator($pValue = '') { $this->creator = $pValue; return $this; } /** * Get Last Modified By. * * @return string */ public function getLastModifiedBy() { return $this->lastModifiedBy; } /** * Set Last Modified By. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setLastModifiedBy($pValue = '') { $this->lastModifiedBy = $pValue; return $this; } /** * Get Created. * * @return int */ public function getCreated() { return $this->created; } /** * Set Created. * * @param int $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setCreated($pValue = null) { if (\is_null($pValue)) { $pValue = \time(); } $this->created = $pValue; return $this; } /** * Get Modified. * * @return int */ public function getModified() { return $this->modified; } /** * Set Modified. * * @param int $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setModified($pValue = null) { if (\is_null($pValue)) { $pValue = \time(); } $this->modified = $pValue; return $this; } /** * Get Title. * * @return string */ public function getTitle() { return $this->title; } /** * Set Title. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setTitle($pValue = '') { $this->title = $pValue; return $this; } /** * Get Description. * * @return string */ public function getDescription() { return $this->description; } /** * Set Description. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setDescription($pValue = '') { $this->description = $pValue; return $this; } /** * Get Subject. * * @return string */ public function getSubject() { return $this->subject; } /** * Set Subject. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setSubject($pValue = '') { $this->subject = $pValue; return $this; } /** * Get Keywords. * * @return string */ public function getKeywords() { return $this->keywords; } /** * Set Keywords. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setKeywords($pValue = '') { $this->keywords = $pValue; return $this; } /** * Get Category. * * @return string */ public function getCategory() { return $this->category; } /** * Set Category. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setCategory($pValue = '') { $this->category = $pValue; return $this; } /** * Get Company. * * @return string */ public function getCompany() { return $this->company; } /** * Set Company. * * @param string $pValue * * @return \PhpOffice\PhpPresentation\DocumentProperties */ public function setCompany($pValue = '') { $this->company = $pValue; return $this; } /** * Get a List of Custom Property Names. * * @return array */ public function getCustomProperties(): array { return \array_keys($this->customProperties); } /** * Check if a Custom Property is defined. * * @param string $propertyName * * @return bool */ public function isCustomPropertySet(string $propertyName): bool { return isset($this->customProperties[$propertyName]); } /** * Get a Custom Property Value. * * @param string $propertyName * * @return mixed|null */ public function getCustomPropertyValue(string $propertyName) { if ($this->isCustomPropertySet($propertyName)) { return $this->customProperties[$propertyName]['value']; } return null; } /** * Get a Custom Property Type. * * @param string $propertyName * * @return string|null */ public function getCustomPropertyType(string $propertyName): ?string { if ($this->isCustomPropertySet($propertyName)) { return $this->customProperties[$propertyName]['type']; } return null; } /** * Set a Custom Property. * * @param string $propertyName * @param mixed $propertyValue * @param string|null $propertyType * 'i' : Integer * 'f' : Floating Point * 's' : String * 'd' : Date/Time * 'b' : Boolean * * @return self */ public function setCustomProperty(string $propertyName, $propertyValue = '', ?string $propertyType = null): self { if (!\in_array($propertyType, [ self::PROPERTY_TYPE_INTEGER, self::PROPERTY_TYPE_FLOAT, self::PROPERTY_TYPE_STRING, self::PROPERTY_TYPE_DATE, self::PROPERTY_TYPE_BOOLEAN, ])) { if (\is_float($propertyValue)) { $propertyType = self::PROPERTY_TYPE_FLOAT; } elseif (\is_int($propertyValue)) { $propertyType = self::PROPERTY_TYPE_INTEGER; } elseif (\is_bool($propertyValue)) { $propertyType = self::PROPERTY_TYPE_BOOLEAN; } else { $propertyType = self::PROPERTY_TYPE_STRING; } } $this->customProperties[$propertyName] = [ 'value' => $propertyValue, 'type' => $propertyType, ]; return $this; } }