本文整理匯總了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);
}