cleaning up debug output

This commit is contained in:
Viktor Pedersen 2021-09-13 11:14:46 +02:00
parent 84ee8f10d6
commit 0eebf93cca
2 changed files with 2 additions and 15 deletions

@ -111,7 +111,7 @@ class Product extends Entity {
}
public function matches($terms, $matchAll=false) {
print('DEBUG $terms: ');
print('DEBUG $terms in matches: ');
var_dump($terms);
print('<br><br>');
$terms = $this->specify_search($terms, array('brand',

@ -64,29 +64,17 @@ class SearchPage extends Page {
$mustMatchArray = array();
$cannotMatchArray = array();
$mayMatchArray = array();
foreach($terms as $key => $value) {
var_dump("dump term: ", $value);
if(!is_array($value)) {
$value = array($value);
}
foreach($value as $term) {
print('DEBUG $parsedTerm: ');
var_dump($term);
print('<br>DEBUG $parsedTerm[0]: ');
var_dump($term[0]);
print('<br>');
switch ($term[0]) {
case "+":
if (!array_key_exists($key, $mustMatchArray)) {
$mustMatchArray[$key] = array();
}
$mustMatchArray[$key][] = substr($term, 1);
print('DEBUG $mustMatchArray: ');
var_dump($mustMatchArray);
print('<br>');
break;
case "!":
case "-":
@ -113,7 +101,6 @@ class SearchPage extends Page {
$items = get_items($type);
$sanitizedItems = array();
$out = array();
foreach($items as $item) {
$result = $item->matches($mustMatchArray, True);
if($result) {
@ -160,7 +147,7 @@ class SearchPage extends Page {
// }
// }
}
print('DEBUG $out: ');
print('DEBUG $sanitizedItems: ');
var_dump($sanitizedItems);
print('<br><br>');
// $out = array();