testing search function

This commit is contained in:
Viktor Pedersen 2021-08-19 10:05:44 +02:00
parent 795f007153
commit 428780eb6f

@ -92,7 +92,7 @@ class SearchPage extends Page {
$items = get_items($type);
$sanitizedDB = array();
foreach($items as $key => $item) {
foreach($items as $item) {
$mustMatchCheck = array();
foreach($mustIncludeArray as $mustIncludeItem) { // pajar om Arrayen enbart har ett item???
@ -106,25 +106,25 @@ class SearchPage extends Page {
}
}
if (array_product($mustMatchCheck)) {
$sanitizedDB[] = array($item);
}
// if (array_product($mustMatchCheck)) {
// $sanitizedDB[] = array($item);
// }
}
$out = array();
foreach ($sanitizedDB as $sanitizedItem) {
if ($sanitizedItem->matches($mustExcludeArray)) {
// $out = array();
// foreach ($sanitizedDB as $sanitizedItem) {
// if ($sanitizedItem->matches($mustExcludeArray)) {
// === IF TRUE DO NOTHING ===
// // === IF TRUE DO NOTHING ===
} else {
// $result = $sanitizedItem->matches($canIncludeArray);
// if($result) {
// $out[] = array($sanitizedItem, $result);
// }
}
}
return $out;
// } else {
// // $result = $sanitizedItem->matches($canIncludeArray);
// // if($result) {
// // $out[] = array($sanitizedItem, $result);
// // }
// }
// }
// return $out;
}
private function translate_terms($terms) {