From 9f9fd166f603fd6b640a36c2fd5aab27f4b25ccb Mon Sep 17 00:00:00 2001
From: Viktor Pedersen <viktor@dsv.su.se>
Date: Wed, 8 Sep 2021 10:30:39 +0200
Subject: [PATCH] testing search function

---
 include/SearchPage.php | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/include/SearchPage.php b/include/SearchPage.php
index f351a24..18469f4 100644
--- a/include/SearchPage.php
+++ b/include/SearchPage.php
@@ -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();