From ec6196b6a86f14303b58b04bd7029271207e6146 Mon Sep 17 00:00:00 2001 From: erth9960 <thuning@dsv.su.se> Date: Wed, 8 Sep 2021 11:01:25 +0200 Subject: [PATCH] Testing a modified match function --- include/Product.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/Product.php b/include/Product.php index c4f342b..d84ec1d 100644 --- a/include/Product.php +++ b/include/Product.php @@ -110,7 +110,7 @@ class Product extends Entity { return true; } - public function matches($terms) { + public function matches($terms, $matchAll=false) { $terms = $this->specify_search($terms, array('brand', 'name', 'serial', @@ -140,6 +140,9 @@ class Product extends Entity { } } } + if($matchAll && array_diff_assoc($terms, $matches)) { + return array(); + } return $matches; }