當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JHelperContent::getRowData方法代碼示例

本文整理匯總了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;
 }
開發者ID:fur81,項目名稱:zofaxiopeu,代碼行數:47,代碼來源:tags.php

示例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;
 }
開發者ID:GitIPFire,項目名稱:Homeworks,代碼行數:39,代碼來源:tags.php


注:本文中的JHelperContent::getRowData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。