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


PHP Translation::newFromRow方法代碼示例

本文整理匯總了PHP中Translation::newFromRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translation::newFromRow方法的具體用法?PHP Translation::newFromRow怎麽用?PHP Translation::newFromRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Translation的用法示例。


在下文中一共展示了Translation::newFromRow方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAllTranslations

 /**
  * @return Translation[]
  */
 public function getAllTranslations()
 {
     $dbr = Database::getConnection(DB_SLAVE);
     $rows = $dbr->select(array('cx_translations', 'cx_translators'), '*', array('translator_translation_id = translation_id', 'translator_user_id' => $this->getGlobalUserId()), __METHOD__, array('ORDER BY' => 'translation_last_updated_timestamp DESC'));
     $result = array();
     foreach ($rows as $row) {
         $result[] = Translation::newFromRow($row);
     }
     return $result;
 }
開發者ID:Wikia,項目名稱:mediawiki-extensions-ContentTranslation,代碼行數:13,代碼來源:Translator.php

示例2: getAllTranslations

 /**
  * @param int $limit How many results to return
  * @param string [$offset] Offset condition (timestamp)
  * @return Translation[]
  */
 public function getAllTranslations($limit, $offset = null, $type = null)
 {
     // Note: there is no index on translation_last_updated_timestamp
     $dbr = Database::getConnection(DB_SLAVE);
     $tables = array('cx_translations', 'cx_translators');
     $fields = '*';
     $conds = array('translator_translation_id = translation_id', 'translator_user_id' => $this->getGlobalUserId());
     if ($type !== null) {
         $conds['translation_status'] = $type;
     }
     if ($offset !== null) {
         $ts = $dbr->addQuotes($dbr->timestamp($offset));
         $conds[] = "translation_last_updated_timestamp < {$ts}";
     }
     $options = array('ORDER BY' => 'translation_last_updated_timestamp DESC', 'LIMIT' => $limit);
     $res = $dbr->select($tables, $fields, $conds, __METHOD__, $options);
     $result = array();
     foreach ($res as $row) {
         $result[] = Translation::newFromRow($row);
     }
     return $result;
 }
開發者ID:Rjaylyn,項目名稱:mediawiki-extensions-ContentTranslation,代碼行數:27,代碼來源:Translator.php

示例3: newFromId

 public static function newFromId($translationId)
 {
     $dbr = Database::getConnection(DB_SLAVE);
     $rows = $dbr->select(array('cx_translations', 'cx_drafts'), '*', array('translation_id' => $translationId, 'draft_id' => $translationId), __METHOD__);
     $result = array();
     foreach ($rows as $row) {
         $result[] = Translation::newFromRow($row);
     }
     return $result;
 }
開發者ID:Wikia,項目名稱:mediawiki-extensions-ContentTranslation,代碼行數:10,代碼來源:Translation.php


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