当前位置: 首页>>代码示例>>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;未经允许,请勿转载。