ContentHistoryHelper
Extends \Joomla\CMS\Helper\CMSHelperVersions 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
string
The 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\Table
Table object being versioned
Response
boolean
true on success, otherwise false.
getCurrentLanguage
Gets the current language
getCurrentLanguage(boolean $detectBrowser = true) : string
since |
3.2 |
---|
Arguments
- $detectBrowser
boolean
Flag indicating whether to use the browser language as a fallback.
Response
string
The language string
getDataObject
Method to get an object containing all of the table columns and values.
getDataObject(\Joomla\CMS\Table\TableInterface $table) : \stdClass
since |
3.2 |
---|
Arguments
- $table
\Joomla\CMS\Table\TableInterface
Table object.
Response
\stdClass
Contains 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
integer
Type id for this component item.- $id
mixed
Primary key of row to get history for.
Response
mixed
The return value or null if the query failed.
getLanguageId
Gets the associated language ID
getLanguageId(string $langCode) : integer
since |
3.2 |
---|
Arguments
- $langCode
string
The language code to look up
Response
integer
The language ID
getRowData
Gets a row of data from a table
getRowData(\Joomla\CMS\Table\TableInterface $table) : array
since |
3.2 |
---|
Arguments
- $table
\Joomla\CMS\Table\TableInterface
Table instance for a row.
Response
array
Associative 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\Table
Table object being versioned
Response
boolean
True on success, otherwise false.
Properties
typeAlias
Alias for storing type in versions table
since |
3.2 |
---|
Type(s)
string