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


PHP eZSearch::buildSearchArray方法代码示例

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


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

示例1: array

    if (is_array($http->variable('SubTreeArray'))) {
        $subTreeList = $http->variable('SubTreeArray');
    } else {
        $subTreeList = array($http->variable('SubTreeArray'));
    }
    foreach ($subTreeList as $subTreeItem) {
        // as form input is generally a string, is_int cannot be used for checking the value type
        if (is_numeric($subTreeItem) && $subTreeItem > 0) {
            $subTreeArray[] = $subTreeItem;
        }
    }
}
$Module->setTitle("Search for: {$searchText}");
$classArray = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => 'asc'));
$sectionArray = eZSection::fetchList();
$searchArray = eZSearch::buildSearchArray();
if ($useSearchCode) {
    $searchResult = eZSearch::search($searchText, array('SearchSectionID' => $searchSectionID, 'SearchContentClassID' => $searchContentClassID, 'SearchContentClassAttributeID' => $searchContentClassAttributeID, 'SearchSubTreeArray' => $subTreeArray, 'SearchDate' => $searchDate, 'SearchTimestamp' => $searchTimestamp, 'SearchLimit' => $pageLimit, 'SearchOffset' => $Offset), $searchArray);
    if (strlen(trim($searchText)) == 0 && count($searchArray) > 0) {
        $searchText = 'search by additional parameter';
    }
}
$viewParameters = array('offset' => $Offset);
$searchData = false;
$tpl->setVariable("search_data", $searchData);
$tpl->setVariable('search_contentclass_id', $searchContentClassID);
$tpl->setVariable('search_contentclass_attribute_id', $searchContentClassAttributeID);
$tpl->setVariable('search_section_id', $searchSectionID);
$tpl->setVariable('search_date', $searchDate);
$tpl->setVariable('search_timestamp', $searchTimestamp);
$tpl->setVariable('search_sub_tree', $subTreeArray);
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:advancedsearch.php

示例2: fetchContentSearch

 public static function fetchContentSearch($searchText, $subTreeArray, $offset, $limit, $searchTimestamp, $publishDate, $sectionID, $classID, $classAttributeID, $ignoreVisibility, $limitation, $sortArray)
 {
     $searchArray = eZSearch::buildSearchArray();
     $parameters = array();
     if ($classID !== false) {
         $parameters['SearchContentClassID'] = $classID;
     }
     if ($classAttributeID !== false) {
         $parameters['SearchContentClassAttributeID'] = $classAttributeID;
     }
     if ($sectionID !== false) {
         $parameters['SearchSectionID'] = $sectionID;
     }
     if ($publishDate !== false) {
         $parameters['SearchDate'] = $publishDate;
     }
     if ($sortArray !== false) {
         $parameters['SortArray'] = $sortArray;
     }
     $parameters['SearchLimit'] = $limit;
     $parameters['SearchOffset'] = $offset;
     $parameters['IgnoreVisibility'] = $ignoreVisibility;
     $parameters['Limitation'] = $limitation;
     if ($subTreeArray !== false) {
         $parameters['SearchSubTreeArray'] = $subTreeArray;
     }
     if ($searchTimestamp) {
         $parameters['SearchTimestamp'] = $searchTimestamp;
     }
     $searchResult = eZSearch::search($searchText, $parameters, $searchArray);
     return array('result' => $searchResult);
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:32,代码来源:ezcontentfunctioncollection.php


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