class ContentHistoryHelper extends CMSHelper

Versions helper class, provides methods to perform various tasks relevant versioning of content.

Properties

string $typeAlias Alias for storing type in versions table

Methods

string
getCurrentLanguage( boolean $detectBrowser = true)

Gets the current language

from CMSHelper
integer
getLanguageId( string $langCode)

Gets the associated language ID

from CMSHelper
array
getRowData( TableInterface $table)

Gets a row of data from a table

from CMSHelper
getDataObject( TableInterface $table)

Method to get an object containing all of the table columns and values.

from CMSHelper
__construct( string $typeAlias = null)

Constructor

boolean
deleteHistory( Table $table)

Method to delete the history for an item.

mixed
getHistory( integer $typeId, mixed $id)

Method to get a list of available versions of this item.

boolean
store( Table $table)

Method to save a version snapshot to the content history table.

Details

string getCurrentLanguage( boolean $detectBrowser = true)

Gets the current language

Parameters

boolean $detectBrowser Flag indicating whether to use the browser language as a fallback.

Return Value

string The language string

integer getLanguageId( string $langCode)

Gets the associated language ID

Parameters

string $langCode The language code to look up

Return Value

integer The language ID

array getRowData( TableInterface $table)

Gets a row of data from a table

Parameters

TableInterface $table Table instance for a row.

Return Value

array Associative array of all columns and values for a row in a table.

stdClass getDataObject( TableInterface $table)

Method to get an object containing all of the table columns and values.

Parameters

TableInterface $table Table object.

Return Value

stdClass Contains all of the columns and values.

__construct( string $typeAlias = null)

Constructor

Parameters

string $typeAlias The type of content to be versioned (for example, 'com_content.article').

boolean deleteHistory( Table $table)

Method to delete the history for an item.

Parameters

Table $table Table object being versioned

Return Value

boolean true on success, otherwise false.

mixed getHistory( integer $typeId, mixed $id)

Method to get a list of available versions of this item.

Parameters

integer $typeId Type id for this component item.
mixed $id Primary key of row to get history for.

Return Value

mixed The return value or null if the query failed.

boolean store( Table $table)

Method to save a version snapshot to the content history table.

Parameters

Table $table Table object being versioned

Return Value

boolean True on success, otherwise false.