testing search function

This commit is contained in:
Viktor Pedersen 2021-09-08 10:26:59 +02:00
parent bb03439acf
commit a850841dbc

@ -102,20 +102,22 @@ class SearchPage extends Page {
$items = get_items($type);
$sanitizedItems = array();
foreach($items as $item) {
$mustMatch = $item->matches($mustMatchArray);
// $mustMatch = $item->matches($mustMatchArray);
if($mustMatch) {
$sanitizedItems[] = array($item, $mustMatch);
$mustMatchCheck = array();
foreach($mustMatchArray as $mustMatchTerm) {
$mustMatch = $item->matches($mustMatchTerm);
if ($mustMatch) {
$mustMatchCheck[] = True;
} else {
$mustMatchCheck[] = False;
}
}
// $mustIncludeCheck = array();
// foreach($mustIncludeArray as $mustIncludeTerm) {
// if ($item->matches($mustIncludeTerm)) {
// $mustIncludeCheck[] = True;
// } else {
// $mustIncludeCheck[] = False;
// }
// }
if(in_array(False, $mustMatchCheck, True) === False) {
$sanitizedItems[] = array($item, $mustMatch);
}
// $mustExcludeCheck = array();
// foreach($mustExcludeArray as $mustExcludeTerm) {
@ -144,7 +146,7 @@ class SearchPage extends Page {
foreach($sanitizedItems as $sanitizedItem) {
print('DEBUG $sanitizedItem: ');
var_dump($sanitizedItem);
var_dump($sanitizedItem;
print('<br><br>');
}