com\setasign\SetaSite\Page
PageHistory
File: /SetaSite/src/Page/PageHistory.php
Class hierarchy
Summary
Constants
TYPE_APPROVE
TYPE_CREATE
TYPE_DELETE
TYPE_MOVE
TYPE_REVERT
TYPE_UPDATE
Properties
$historyTable
Methods
cleanupHistory()
Cleanup the history for $pageId since the last approve/revert. If one user saves the same page multiple times after each other those changes will be merged to one single change. The merges are user based. If the changes are over multiple days the last copy of each day will be kept.
E.g. UserA saves 5 times -> UserB saves 4 times -> UserA saves 2 times -> UserC approves the pages (all on the same day). This will result in 3 updates (2 by UserA and 1 by UserB) and 1 approve (by UserC).
Parameters
- $pageId : int
- $language : string
Exceptions
Throws \Exception
createHistoryEntry()
string $pageLanguage,
int $userId,
int $type,
array $typeData = array ( )
Creates a history entry.
Parameters
- $pageId : int
- $pageLanguage : string
- $userId : int
- $type : int
- $typeData : array
Type dependent data.
Return Values
History id
Exceptions
Throws \com\setasign\SetaSite\Exception
Throws \com\setasign\SetaFramework\Exception
Throws \JsonException
Throws \Exception
deleteHistoryEntries()
Delete multiple history entries. It doesn't matter whether the ids do exist.
Parameters
- $ids : int[]
editNote()
Parameters
- $historyId : int
- $note : string
Exceptions
Throws \com\setasign\SetaFramework\Exception
getHistoryEntriesByPage()
Get all history entries ordered by datetime (descending).
Parameters
- $pageId : int
- $language : string
Return Values
Array with the keys ['historyId', 'datetime', 'note', 'userId']
