ContentHistoryHelper

Extends CMSHelper

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

deprecated
since

3.2

deprecated

4.0 Deprecated in favour of \Joomla\CMS\Versioning\Versioning in Joomla 4

package

Joomla CMS

Methods

__construct

Constructor

__construct(string typeAlias = null) : mixed
deprecated
since

3.2

deprecated

4.0

Arguments

typeAlias

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

Response

mixed

deleteHistory

Method to delete the history for an item.

deleteHistory(\Joomla\CMS\Table\Table table) : bool
deprecated
since

3.2

deprecated

4.0 Use \Joomla\CMS\Versioning\Versioning::delete in Joomla 4

Arguments

table

\Joomla\CMS\Table\TableTable object being versioned

Response

booltrue on success, otherwise false.

getCurrentLanguage

Gets the current language

getCurrentLanguage(bool detectBrowser = true) : string
inherited
since

3.2

Arguments

detectBrowser

boolFlag 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(int typeId, mixed id) : mixed
deprecated
since

3.2

deprecated

4.0 Use \Joomla\CMS\Versioning\Versioning::get in Joomla 4

Arguments

typeId

intType 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) : int
inherited
since

3.2

Arguments

langCode

stringThe language code to look up

Response

intThe 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) : bool
deprecated
since

3.2

deprecated

4.0 Use \Joomla\CMS\Versioning\Versioning::store in Joomla 4

Arguments

table

\Joomla\CMS\Table\TableTable object being versioned

Response

boolTrue on success, otherwise false.

Properties

typeAlias

Alias for storing type in versions table

deprecated
since

3.2

deprecated

4.0

Type(s)

string