Advertisement
Guest User

Generic Loop - Example

a guest
Mar 26th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1.     public function actionThreadsReindexAll()
  2.     {
  3.         if ($this->isConfirmedPost())
  4.         {
  5.                 $words = $this->_getChineseWordModel()->getAllWords();
  6.        
  7.                 if(is_array($words) AND !empty($words))
  8.                 {
  9.                 $this->_assertPostOnly();
  10.        
  11.                 return $this->_queueLoop('reindexall', 100, $words, 'chinese-words/threads-options', 'sedo_chinese_reindex_all_words');
  12.                 }
  13.                 else
  14.                 {
  15.                 return $this->responseRedirect(
  16.                     XenForo_ControllerResponse_Redirect::SUCCESS,
  17.                     XenForo_Link::buildAdminLink('chinese-words/threads-options'),
  18.                     new XenForo_Phrase('sedo_chinese_no_words_to_reindex')
  19.                 );
  20.                 }
  21.         }
  22.  
  23.         $viewParams = array('cmd' => 'threads-reindex-all');
  24.         return $this->responseView('Sedo_Chinese_ViewAdmin_ChineseThreads_Confirm', 'chinese_words_threads_confirm', $viewParams);
  25.     }
  26.  
  27.     private function _reindexall($word)
  28.     {
  29.         $word = $this->_SedoChineseAddUpdateThread($word);
  30.             $dw = XenForo_DataWriter::create('Sedo_Chinese_DataWriter_ChineseWords');
  31.             $dw->setExistingData($word['word_id']);
  32.             $dw->bulkSet($word);
  33.             $dw->save();
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement