本文整理汇总了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) . " <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');
示例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);
}