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


PHP DBObjectSearch::AddCondition_FullText方法代碼示例

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


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

示例1: trim

     }
     break;
 case 'full_text_search_enlarge':
     $sFullText = trim(utils::ReadParam('text', '', false, 'raw_data'));
     $sClass = trim(utils::ReadParam('class', ''));
     $iTune = utils::ReadParam('tune', 0);
     if (preg_match('/^"(.*)"$/', $sFullText, $aMatches)) {
         // The text is surrounded by double-quotes, remove the quotes and treat it as one single expression
         $aFullTextNeedles = array($aMatches[1]);
     } else {
         // Split the text on the blanks and treat this as a search for <word1> AND <word2> AND <word3>
         $aFullTextNeedles = explode(' ', $sFullText);
     }
     $oFilter = new DBObjectSearch($sClass);
     foreach ($aFullTextNeedles as $sSearchText) {
         $oFilter->AddCondition_FullText($sSearchText);
     }
     $oSet = new DBObjectSet($oFilter);
     $oPage->add("<div class=\"page_header\">\n");
     $oPage->add("<h2>" . MetaModel::GetClassIcon($sClass) . "&nbsp;<span class=\"hilite\">" . Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', $oSet->Count(), Metamodel::GetName($sClass)) . "</h2>\n");
     $oPage->add("</div>\n");
     if ($oSet->Count() > 0) {
         $aLeafs = array();
         while ($oObj = $oSet->Fetch()) {
             if (get_class($oObj) == $sClass) {
                 $aLeafs[] = $oObj->GetKey();
             }
         }
         $oLeafsFilter = new DBObjectSearch($sClass);
         if (count($aLeafs) > 0) {
             $oLeafsFilter->AddCondition('id', $aLeafs, 'IN');
開發者ID:kira8565,項目名稱:ITOP203-ZHCN,代碼行數:31,代碼來源:ajax.render.php

示例2: DoExecute

 protected function DoExecute()
 {
     echo "<h3>Create protagonists...</h3>";
     $iId1 = $this->InsertMammal('human', 'male', 10, 0, 0, 'romanoff', 192, '1971-07-19');
     $iId2 = $this->InsertMammal('human', 'female', 9, 0, 0, 'rouanita', 165, '1983-01-23');
     $this->InsertMammal('human', 'female', 3, $iId2, $iId1, 'pomme', 169, '2008-02-23');
     $this->InsertMammal('pig', 'female', 3, 0, 0, 'grouinkette', 85, '2006-06-01');
     $this->InsertMammal('donkey', 'female', 3, 0, 0, 'muleta', 124, '2003-11-11');
     $this->InsertBird('rooster', 'male', 12, 0, 0);
     $this->InsertFlyingBird('pie', 'female', 11, 0, 0, 35);
     echo "<h3>Search...</h3>";
     $oSearch = new DBObjectSearch('Mammal');
     $oSearch->AddCondition_FullText('manof');
     //$oResultSet = new DBObjectSet($oSearch);
     $this->search_and_show_list($oSearch);
 }
開發者ID:besmirzanaj,項目名稱:itop-code,代碼行數:16,代碼來源:testlist.inc.php


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