本文整理汇总了PHP中JTable::checkIn方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::checkIn方法的具体用法?PHP JTable::checkIn怎么用?PHP JTable::checkIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTable
的用法示例。
在下文中一共展示了JTable::checkIn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadHistory
/**
* Method to load a row for editing from the version history table.
*
* @param integer $version_id Key to the version history table.
* @param JTable &$table Content table object being loaded.
*
* @return boolean False on failure or error, true otherwise.
*
* @since 12.2
*/
public function loadHistory($version_id, JTable &$table)
{
// Only attempt to check the row in if it exists.
if ($version_id) {
$user = JFactory::getUser();
// Get an instance of the row to checkout.
$historyTable = JTable::getInstance('History', 'ContenthistoryTable');
if (!$historyTable->load($version_id)) {
$this->setError($historyTable->getError());
return false;
}
$rowArray = JArrayHelper::fromObject(json_decode($historyTable->version_data));
$typeId = JTable::getInstance('Types', 'ContentTable')->getTypeId($this->typeAlias);
if ($historyTable->ucm_type_id != $typeId) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_HISTORY_ID_MISMATCH'));
$key = $table->getKeyName();
if (isset($rowArray[$key])) {
$table->checkIn($rowArray[$key]);
}
return false;
}
}
$this->setState('save_date', $historyTable->save_date);
$this->setState('version_note', $historyTable->version_note);
return $table->bind($rowArray);
}