本文整理汇总了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;
}