Skip to content

Commit

Permalink
Add read/write Revision document attribut
Browse files Browse the repository at this point in the history
Add read/write Revision document attribut. Informations are stored into document properties. Available for Powerpoint 2007 (reading/writing)
  • Loading branch information
devX2712 committed Aug 14, 2020
1 parent a352768 commit 1ea39dd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/PhpPresentation/DocumentProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ class DocumentProperties
* @var string
*/
private $company;


/**
* revision
*
* @var string
*/
private $revision;

/**
* Create a new \PhpOffice\PhpPresentation\DocumentProperties
*/
Expand All @@ -108,6 +115,7 @@ public function __construct()
$this->keywords = '';
$this->category = '';
$this->company = 'Microsoft Corporation';
$this->revision = '';
}

/**
Expand Down Expand Up @@ -345,4 +353,28 @@ public function setCompany($pValue = '')

return $this;
}

/**
* Get Revision
*
* @return string
*/
public function getRevision()
{
return $this->revision;
}

/**
* Set Revision
*
* @param string $pValue
* @return \PhpOffice\PhpPresentation\DocumentProperties
*/
public function setRevision($pValue = '')
{
$this->revision = $pValue;

return $this;
}

}
1 change: 1 addition & 0 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ protected function loadDocumentProperties($sPart)
'/cp:coreProperties/cp:category' => 'setCategory',
'/cp:coreProperties/dcterms:created' => 'setCreated',
'/cp:coreProperties/dcterms:modified' => 'setModified',
'/cp:coreProperties/cp:revision' => 'setRevision',
);
$oProperties = $this->oPhpPresentation->getDocumentProperties();
foreach ($arrayProperties as $path => $property) {
Expand Down
3 changes: 3 additions & 0 deletions src/PhpPresentation/Writer/PowerPoint2007/DocPropsCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public function render()
// cp:keywords
$objWriter->writeElement('cp:keywords', $this->oPresentation->getDocumentProperties()->getKeywords());

// cp:revision
$objWriter->writeElement('cp:revision', $this->oPresentation->getDocumentProperties()->getRevision());

// cp:category
$objWriter->writeElement('cp:category', $this->oPresentation->getDocumentProperties()->getCategory());

Expand Down

0 comments on commit 1ea39dd

Please sign in to comment.