Contentserv PHP API

CSItemApiHistory
in package

Defines API method of Item Action History in the ItemModell

Tags
access

public

since
5.0

Table of Contents

__call()  : mixed
Relay function calls to item this function is used if a function was called that is not available from this class
__construct()  : mixed
Instanciates the CSItemApiHistory
deleteAllVersions()  : void
deletes all versions of the current item
deleteVersion()  : void
deletes the version with the given version number
dropOlderVersions()  : int
Delete versions prior to the given version number
getChanges()  : array<string|int, mixed>
fetch all configuration and locale changes for a given versionNr. Returns an array that contains subarrays. to differentiate between locale changes and configuration changes, the subarray field "id" is either a numeric value (the file id) or a string ("locale").
getEntries()  : array<string|int, mixed>
Fetches all entries that are available from the history database for the given item.
getVersionNumbers()  : array<string|int, mixed>
Retrieve list of version numbers that are available from the action history database of the current item
restoreVersion()  : CSItemApiItem
overwrite current version with data from a previous version
rollback()  : mixed
Rollbacks the current item to a given version number while deleting all item versions that have been created after this one

Methods

__call()

Relay function calls to item this function is used if a function was called that is not available from this class

public __call(mixed $name, mixed $arguments) : mixed
Parameters
$name : mixed

function name

$arguments : mixed
Tags
access

public

Return values
mixed

__construct()

Instanciates the CSItemApiHistory

public __construct(object $item) : mixed
Parameters
$item : object

instance of the item this Api shall be referring to

Tags
Return values
mixed

deleteAllVersions()

deletes all versions of the current item

public deleteAllVersions() : void
Tags
access

public

Return values
void

deleteVersion()

deletes the version with the given version number

public deleteVersion(int $versionNr) : void
Parameters
$versionNr : int

the number of the version to delete

Tags
access

public

Return values
void

dropOlderVersions()

Delete versions prior to the given version number

public dropOlderVersions(int $versionNr) : int
Parameters
$versionNr : int

Last version that should be kept

Tags
access

public

Return values
int

Number of deleted version items

getChanges()

fetch all configuration and locale changes for a given versionNr. Returns an array that contains subarrays. to differentiate between locale changes and configuration changes, the subarray field "id" is either a numeric value (the file id) or a string ("locale").

public getChanges(int $versionNr[, mixed $languageId = null ]) : array<string|int, mixed>
Parameters
$versionNr : int

number of the version that should be checked for changes

$languageId : mixed = null

if int this contains the language id

Tags
access

public

Return values
array<string|int, mixed>

getEntries()

Fetches all entries that are available from the history database for the given item.

public getEntries([string $filter = '' ][, string $sortOrder = null ]) : array<string|int, mixed>
Parameters
$filter : string = ''

a filter that should be used to load the entries

$sortOrder : string = null

the sort order that should be used

Tags
Return values
array<string|int, mixed>

Returns an array of Itemactionhistory elements Itemactionhistory

getVersionNumbers()

Retrieve list of version numbers that are available from the action history database of the current item

public getVersionNumbers([string $filter = '' ]) : array<string|int, mixed>
Parameters
$filter : string = ''

a sql filter that should be used to load the entries

Tags
Return values
array<string|int, mixed>

Contains all version numbers

restoreVersion()

overwrite current version with data from a previous version

public restoreVersion(mixed $versionNr) : CSItemApiItem
Parameters
$versionNr : mixed

version number of source

Tags
access

public

Return values
CSItemApiItem

rollback()

Rollbacks the current item to a given version number while deleting all item versions that have been created after this one

public rollback(int $targetVersionNr) : mixed
Parameters
$targetVersionNr : int

number of version number to rollback to

Tags
Return values
mixed

        

Search results