mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 16:43:48 +00:00
create recompose method + test (skipped), fix tests for dateParse
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user