ContentHistoryHelper

Extends \Joomla\CMS\Helper\CMSHelper

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

since

3.2

Methods

__construct

Constructor

__construct(string $typeAlias = null) 
since

3.2

Arguments

$typeAlias

stringThe type of content to be versioned (for example, 'com_content.article').

deleteHistory

Method to delete the history for an item.

deleteHistory(\Joomla\CMS\Table\Table $table) : boolean
since

3.2

Arguments

$table

\Joomla\CMS\Table\TableTable object being versioned

Response

booleantrue on success, otherwise false.

getCurrentLanguage

Gets the current language

getCurrentLanguage(boolean $detectBrowser = true) : string
inherited
since

3.2

Arguments

$detectBrowser

booleanFlag indicating whether to use the browser language as a fallback.

Response

stringThe language string

getDataObject

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

getDataObject(\Joomla\CMS\Table\TableInterface $table) : \stdClass
inherited
since

3.2

Arguments

$table

\Joomla\CMS\Table\TableInterfaceTable object.

Response

\stdClassContains all of the columns and values.

getHistory

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

getHistory(integer $typeId, mixed $id) : mixed
since

3.2

Arguments

$typeId

integerType id for this component item.

$id

mixedPrimary key of row to get history for.

Response

mixedThe return value or null if the query failed.

getLanguageId

Gets the associated language ID

getLanguageId(string $langCode) : integer
inherited
since

3.2

Arguments

$langCode

stringThe language code to look up

Response

integerThe language ID

getRowData

Gets a row of data from a table

getRowData(\Joomla\CMS\Table\TableInterface $table) : array
inherited
since

3.2

Arguments

$table

\Joomla\CMS\Table\TableInterfaceTable instance for a row.

Response

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

store

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

store(\Joomla\CMS\Table\Table $table) : boolean
since

3.2

Arguments

$table

\Joomla\CMS\Table\TableTable object being versioned

Response

booleanTrue on success, otherwise false.

Properties

typeAlias

Alias for storing type in versions table

since

3.2

Type(s)

string