本文整理匯總了PHP中JHelperContent::getRowData方法的典型用法代碼示例。如果您正苦於以下問題:PHP JHelperContent::getRowData方法的具體用法?PHP JHelperContent::getRowData怎麽用?PHP JHelperContent::getRowData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JHelperContent
的用法示例。
在下文中一共展示了JHelperContent::getRowData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: postStoreProcess
/**
* Function that handles saving tags used in a table class after a store()
*
* @param JTable $table JTable being processed
* @param array $newTags Array of new tags
* @param boolean $replace Flag indicating if all exising tags should be replaced
*
* @return boolean
*
* @since 3.1
*/
public function postStoreProcess($table, $newTags = array(), $replace = true)
{
if (!empty($table->newTags) && empty($newTags)) {
$newTags = $table->newTags;
}
// If existing row, check to see if tags have changed.
$newTable = clone $table;
$newTable->reset();
$key = $newTable->getKeyName();
$typeAlias = $this->typeAlias;
$result = true;
// Process ucm_content and ucm_base if either tags have changed or we have some tags.
if ($this->tagsChanged || $newTags) {
if (!$newTags) {
// Delete all tags data
$key = $table->getKeyName();
$result = $this->deleteTagData($table, $table->{$key});
} else {
// Process the tags
$rowdata = new JHelperContent();
$data = $rowdata->getRowData($table);
$ucmContentTable = JTable::getInstance('Corecontent');
$ucm = new JUcmContent($table, $this->typeAlias);
$ucmData = $data ? $ucm->mapData($data) : $ucm->ucmData;
$primaryId = $ucm->getPrimaryKey($ucmData['common']['core_type_id'], $ucmData['common']['core_content_item_id']);
$result = $ucmContentTable->load($primaryId);
$result = $result && $ucmContentTable->bind($ucmData['common']);
$result = $result && $ucmContentTable->check();
$result = $result && $ucmContentTable->store();
$ucmId = $ucmContentTable->core_content_id;
// Store the tag data if the article data was saved and run related methods.
$result = $result && $this->tagItem($ucmId, $table, $newTags, $replace);
}
}
return $result;
}
示例2: postStoreProcess
/**
* Function that handles saving tags used in a table class after a store()
*
* @param JTable $table JTable being processed
*
* @return null
*
* @since 3.1
*/
public function postStoreProcess($table)
{
$metaObject = json_decode($table->get('metadata'));
$tags = isset($metaObject->tags) ? $metaObject->tags : null;
$result = true;
// Process ucm_content and ucm_base if either tags have changed or we have some tags.
if ($this->tagsChanged || $tags) {
if (!$tags) {
// Delete all tags data
$key = $table->getKeyName();
$result = $this->deleteTagData($table, $table->{$key});
} else {
// Process the tags
$rowdata = new JHelperContent();
$data = $rowdata->getRowData($table);
$ucmContentTable = JTable::getInstance('Corecontent');
$ucm = new JUcmContent($table, $this->typeAlias);
$ucmData = $data ? $ucm->mapData($data) : $ucm->ucmData;
$primaryId = $ucm->getPrimaryKey($ucmData['common']['core_type_id'], $ucmData['common']['core_content_item_id']);
$result = $ucmContentTable->load($primaryId);
$result = $result && $ucmContentTable->bind($ucmData['common']);
$result = $result && $ucmContentTable->check();
$result = $result && $ucmContentTable->store();
$ucmId = $ucmContentTable->core_content_id;
// Store the tag data if the article data was saved and run related methods.
$result = $result && $this->tagItem($ucmId, $table, json_decode($table->metadata)->tags, true);
}
}
return $result;
}