testing search function
This commit is contained in:
parent
1a0bee19e1
commit
eaf81a19cb
@ -86,14 +86,14 @@ class SearchPage extends Page {
|
||||
switch ($parsedTerm[0]) {
|
||||
case "+":
|
||||
// gör $mustIncludeArray till en array av arrayer?
|
||||
$mustIncludeArray[$key] = substr($parsedTerm, 1);
|
||||
$mustIncludeArray[$key] = array($key => substr($parsedTerm, 1));
|
||||
break;
|
||||
case "!":
|
||||
case "-":
|
||||
$mustExcludeArray[$key] = substr($parsedTerm, 1);
|
||||
$mustExcludeArray = array($key => substr($parsedTerm, 1));
|
||||
break;
|
||||
case "~":
|
||||
$canIncludeArray[$key] = substr($parsedTerm, 1);
|
||||
$canIncludeArray[$key] = array($key => substr($parsedTerm, 1));
|
||||
break;
|
||||
default:
|
||||
$canIncludeArray[$key] = $parsedTerm;
|
||||
@ -113,21 +113,21 @@ class SearchPage extends Page {
|
||||
|
||||
$items = get_items($type);
|
||||
$out = array();
|
||||
foreach($items as $item) {
|
||||
// foreach($items as $item) {
|
||||
|
||||
$mustMatchCheck = array();
|
||||
// $mustMatchCheck = array();
|
||||
|
||||
if ($item->matches($mustExcludeArray)) {
|
||||
// if ($item->matches($mustExcludeArray)) {
|
||||
|
||||
// === IF TRUE DO NOTHING ===
|
||||
// // === IF TRUE DO NOTHING ===
|
||||
|
||||
} else {
|
||||
$result = $item->matches($canIncludeArray);
|
||||
if($result) {
|
||||
$out[] = array($item, $result);
|
||||
}
|
||||
}
|
||||
}
|
||||
// } else {
|
||||
// $result = $item->matches($canIncludeArray);
|
||||
// if($result) {
|
||||
// $out[] = array($item, $result);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user