当前位置: 首页>>代码示例>>PHP>>正文


PHP Thread::bulkLoad方法代码示例

本文整理汇总了PHP中Thread::bulkLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP Thread::bulkLoad方法的具体用法?PHP Thread::bulkLoad怎么用?PHP Thread::bulkLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Thread的用法示例。


在下文中一共展示了Thread::bulkLoad方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadFromResult

 static function loadFromResult($res, $db, $bulkLoad = false)
 {
     $rows = array();
     $threads = array();
     foreach ($res as $row) {
         $rows[] = $row;
         if (!$bulkLoad) {
             $threads[$row->thread_id] = Thread::newFromRow($row);
         }
     }
     if (!$bulkLoad) {
         return $threads;
     }
     return Thread::bulkLoad($rows);
 }
开发者ID:Rikuforever,项目名称:wiki,代码行数:15,代码来源:Threads.php

示例2: getThreads

 /**
  * Returns an array of structures. Each structure has the keys 'top' and 'posts'.
  * 'top' contains the top-level thread to display.
  * 'posts' contains an array of integer post IDs which should be highlighted.
  */
 function getThreads()
 {
     $rows = $this->getRows();
     if (!count($rows)) {
         return false;
     }
     $threads = Thread::bulkLoad($rows);
     $thread_ids = array_keys($threads);
     $output = array();
     foreach ($threads as $id => $thread) {
         $output[$id] = array('top' => $thread, 'posts' => array());
     }
     $dbr = wfGetDB(DB_SLAVE);
     $res = $dbr->select(array('user_message_state'), array('ums_thread', 'ums_conversation'), array('ums_user' => $this->user->getId(), 'ums_conversation' => $thread_ids), __METHOD__);
     foreach ($res as $row) {
         $top = $row->ums_conversation;
         $thread = $row->ums_thread;
         $output[$top]['posts'][] = $thread;
     }
     return $output;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:26,代码来源:NewUserMessagesView.php

示例3: replies

 function replies()
 {
     if (!$this->id()) {
         return array();
     }
     if (!is_null($this->replies)) {
         $this->checkReplies($this->replies);
         return $this->replies;
     }
     $this->dieIfHistorical();
     // Check cache
     if (isset(self::$replyCacheById[$this->id()])) {
         return $this->replies = self::$replyCacheById[$this->id()];
     }
     $this->replies = array();
     $dbr = wfGetDB(DB_SLAVE);
     $res = $dbr->select('thread', '*', array('thread_parent' => $this->id(), 'thread_type != ' . $dbr->addQuotes(Threads::TYPE_DELETED)), __METHOD__);
     $rows = array();
     foreach ($res as $row) {
         $rows[] = $row;
     }
     $this->replies = Thread::bulkLoad($rows);
     $this->checkReplies($this->replies);
     return $this->replies;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:25,代码来源:Thread.php

示例4: getPageThreads

 function getPageThreads($pager)
 {
     $rows = $pager->getRows();
     return Thread::bulkLoad($rows);
 }
开发者ID:Rikuforever,项目名称:wiki,代码行数:5,代码来源:TalkpageView.php


注:本文中的Thread::bulkLoad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。