testing new implementation of matching function
This commit is contained in:
parent
18b4267f51
commit
2240fd0e04
@ -102,24 +102,24 @@ class SearchPage extends Page {
|
|||||||
$items = get_items($type);
|
$items = get_items($type);
|
||||||
$sanitizedItems = array();
|
$sanitizedItems = array();
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
// $mustMatch = $item->matches($mustMatchArray);
|
$mustMatch = $item->matches($mustMatchArray, True);
|
||||||
// if($mustMatch) {
|
if($mustMatch) {
|
||||||
// $sanitizedItems[] = array($item, $mustMatch);
|
$sanitizedItems[] = array($item, $mustMatch);
|
||||||
|
}
|
||||||
|
|
||||||
|
// $mustMatchCheck = array();
|
||||||
|
// foreach($mustMatchArray as $mustMatchTerm) {
|
||||||
|
|
||||||
|
// $matchResult = $item->matches($mustMatchTerm);
|
||||||
|
// if ($matchResult) {
|
||||||
|
// $mustMatchCheck[] = True;
|
||||||
|
// } else {
|
||||||
|
// $mustMatchCheck[] = False;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if(in_array(False, $mustMatchCheck, True) === False) {
|
||||||
|
// $sanitizedItems[] = array($item, $matchResult);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$mustMatchCheck = array();
|
|
||||||
foreach($mustMatchArray as $mustMatchTerm) {
|
|
||||||
|
|
||||||
$matchResult = $item->matches($mustMatchTerm);
|
|
||||||
if ($matchResult) {
|
|
||||||
$mustMatchCheck[] = True;
|
|
||||||
} else {
|
|
||||||
$mustMatchCheck[] = False;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(in_array(False, $mustMatchCheck, True) === False) {
|
|
||||||
$sanitizedItems[] = array($item, $matchResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user