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