From 2240fd0e04cfb97942529f9a740c0cb413ee133d Mon Sep 17 00:00:00 2001 From: Viktor Pedersen <viktor@dsv.su.se> Date: Wed, 8 Sep 2021 11:08:44 +0200 Subject: [PATCH] testing new implementation of matching function --- include/SearchPage.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/SearchPage.php b/include/SearchPage.php index 4469353..ea9d9b3 100644 --- a/include/SearchPage.php +++ b/include/SearchPage.php @@ -102,24 +102,24 @@ class SearchPage extends Page { $items = get_items($type); $sanitizedItems = array(); foreach($items as $item) { - // $mustMatch = $item->matches($mustMatchArray); - // if($mustMatch) { - // $sanitizedItems[] = array($item, $mustMatch); + $mustMatch = $item->matches($mustMatchArray, True); + if($mustMatch) { + $sanitizedItems[] = array($item, $mustMatch); + } + + // $mustMatchCheck = array(); + // foreach($mustMatchArray as $mustMatchTerm) { + + // $matchResult = $item->matches($mustMatchTerm); + // if ($matchResult) { + // $mustMatchCheck[] = True; + // } else { + // $mustMatchCheck[] = False; + // } + // } + // if(in_array(False, $mustMatchCheck, True) === False) { + // $sanitizedItems[] = array($item, $matchResult); // } - - $mustMatchCheck = array(); - foreach($mustMatchArray as $mustMatchTerm) { - - $matchResult = $item->matches($mustMatchTerm); - if ($matchResult) { - $mustMatchCheck[] = True; - } else { - $mustMatchCheck[] = False; - } - } - if(in_array(False, $mustMatchCheck, True) === False) { - $sanitizedItems[] = array($item, $matchResult); - }