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);
$sanitizedItems = array();
foreach($items as $item) {
// $mustMatch = $item->matches($mustMatchArray);
$mustMatch = $item->matches($mustMatchArray);
$mustMatchCheck = array();
foreach($mustMatchArray as $mustMatchTerm) {
$matchingResult = $item->matches($mustMatchTerm);
if ($matchingResult) {
$mustMatchCheck[] = True;
} else {
$mustMatchCheck[] = False;
}
}
// $mustMatchCheck = array();
// foreach($mustMatchArray as $mustMatchTerm) {
// $matchingResult = $item->matches($mustMatchTerm);
// if ($matchingResult) {
// $mustMatchCheck[] = True;
// } else {
// $mustMatchCheck[] = False;
// }
// }
if(in_array(False, $mustMatchCheck, True) === False) {
$sanitizedItems[] = array($item);
$sanitizedItems[] = array($item, $mustMatch);
}
// $mustExcludeCheck = array();