Testing a modified match function

This commit is contained in:
erth9960 2021-09-08 11:01:25 +02:00
parent 15d59fd6f6
commit ec6196b6a8

@ -110,7 +110,7 @@ class Product extends Entity {
return true; return true;
} }
public function matches($terms) { public function matches($terms, $matchAll=false) {
$terms = $this->specify_search($terms, array('brand', $terms = $this->specify_search($terms, array('brand',
'name', 'name',
'serial', 'serial',
@ -140,6 +140,9 @@ class Product extends Entity {
} }
} }
} }
if($matchAll && array_diff_assoc($terms, $matches)) {
return array();
}
return $matches; return $matches;
} }