testing search function

This commit is contained in:
Viktor Pedersen 2021-09-08 10:30:39 +02:00
parent 3b4da1e5dd
commit 9f9fd166f6

@ -102,21 +102,22 @@ class SearchPage extends Page {
$items = get_items($type); $items = get_items($type);
$sanitizedItems = array(); $sanitizedItems = array();
foreach($items as $item) { foreach($items as $item) {
// $mustMatch = $item->matches($mustMatchArray); $mustMatch = $item->matches($mustMatchArray);
$mustMatchCheck = array(); // $mustMatchCheck = array();
foreach($mustMatchArray as $mustMatchTerm) { // foreach($mustMatchArray as $mustMatchTerm) {
$matchingResult = $item->matches($mustMatchTerm);
if ($matchingResult) { // $matchingResult = $item->matches($mustMatchTerm);
$mustMatchCheck[] = True; // if ($matchingResult) {
} else { // $mustMatchCheck[] = True;
$mustMatchCheck[] = False; // } else {
} // $mustMatchCheck[] = False;
} // }
// }
if(in_array(False, $mustMatchCheck, True) === False) { if(in_array(False, $mustMatchCheck, True) === False) {
$sanitizedItems[] = array($item); $sanitizedItems[] = array($item, $mustMatch);
} }
// $mustExcludeCheck = array(); // $mustExcludeCheck = array();