testing new matching functionality
This commit is contained in:
parent
2240fd0e04
commit
7166a31d99
include
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class User extends Entity {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function matches($terms) {
|
public function matches($terms, $matchAll=false) {
|
||||||
$terms = $this->specify_search($terms, array('name',
|
$terms = $this->specify_search($terms, array('name',
|
||||||
'email',
|
'email',
|
||||||
'notes'));
|
'notes'));
|
||||||
@ -75,6 +75,9 @@ class User extends Entity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($matchAll && array_diff_assoc($terms, $matches)) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user