create recompose method + test (skipped), fix tests for dateParse

This commit is contained in:
2015-01-06 20:34:27 +01:00
parent 5289ad9c2c
commit a48a0be187
2 changed files with 33 additions and 13 deletions

View File

@@ -52,4 +52,27 @@ abstract class AbstractSearch implements SearchInterface
}
}
protected function recomposePattern(array $terms, array $supportedTerms, $domain = '')
{
$recomposed = '';
if ($domain !== '')
{
$recomposed .= '@'.$domain.' ';
}
foreach ($supportedTerms as $term) {
if (array_key_exists($term, $terms) && $term !== '_default') {
$recomposed .= ' '.$term.':';
$recomposed .= (mb_stristr(' ', $terms[$term]) === FALSE) ? $terms[$term] : '('.$terms[$term].')';
}
}
if ($terms['_default'] !== '') {
$recomposed .= ' '.$terms['_default'];
}
return $recomposed;
}
}