depage-xmldb v2.3.1
XML documents in a relational database
Loading...
Searching...
No Matches
DocumentHistory Class Reference

Detailed Description

Definition at line 15 of file DocumentHistory.php.

Public Member Functions

 __construct (\Depage\Db\Pdo $pdo, $tablePrefix, Document $document)
 getVersions ($published=null, $maxResults=null)
 getVersions
 getLatestVersion ()
 getLatestVersion
 getXml ($timestamp, $addIdAttribute=true)
 getXml
 getLastPublishedXml ($addIdAttribute=true)
 getLastPublishedXml
 save ($userId, $published=false)
 gets the current document xml and saves a version to the history add SHA hash column for data integrity
 restore ($timestamp)
 Restores the document to a previous state.
 delete ($timestamp)
 Delete.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Depage\Db\Pdo $pdo,
$tablePrefix,
Document $document )

Definition at line 23 of file DocumentHistory.php.

Member Function Documentation

◆ delete()

delete ( $timestamp)
Parameters
$timestamp

Definition at line 248 of file DocumentHistory.php.

◆ getLastPublishedXml()

getLastPublishedXml ( $addIdAttribute = true)

load xml from last published version from history

Definition at line 147 of file DocumentHistory.php.

◆ getLatestVersion()

getLatestVersion ( )

gets the last document version

Definition at line 94 of file DocumentHistory.php.

◆ getVersions()

getVersions ( $published = null,
$maxResults = null )

Gets versions of the docment in the history. returns array of time, user_id, published, and hash per version in array indexed on the last change time.

Parameters
bool$published
int$maxResults
Returns
mixed

Definition at line 45 of file DocumentHistory.php.

◆ getXml()

getXml ( $timestamp,
$addIdAttribute = true )
Parameters
int$timestamp
bool$addIdAttribute
Returns
bool|\DOMDocument|object

Definition at line 108 of file DocumentHistory.php.

◆ restore()

restore ( $timestamp)

Definition at line 232 of file DocumentHistory.php.

◆ save()

save ( $userId,
$published = false )
Parameters
int$userId
bool$published
Returns
bool | timestamp

Definition at line 165 of file DocumentHistory.php.


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