public function StreamingExpressionBuilder::_escape_and_implode in Search API Solr 8.2
Same name and namespace in other branches
- 8.3 src/Utility/StreamingExpressionBuilder.php \Drupal\search_api_solr\Utility\StreamingExpressionBuilder::_escape_and_implode()
- 4.x src/Utility/StreamingExpressionBuilder.php \Drupal\search_api_solr\Utility\StreamingExpressionBuilder::_escape_and_implode()
Calls _escaped_value on each array element and returns the imploded result.
Parameters
string $glue The string to put between the escaped values.: This can be used to create an "or" condition from the array of values, for example, by passing the string ' || ' as glue.
array $values The array of values to escape:
bool $single_term Whether to escape as a single term or as a phrase.:
string $search_api_field_name Passed on to _escaped_value();: influences whether processors act on the values.
Return value
string The imploded string of escaped values.
File
- src/
Utility/ StreamingExpressionBuilder.php, line 290
Class
- StreamingExpressionBuilder
- Provides methods for creating streaming expressions targeting a given index.
Namespace
Drupal\search_api_solr\UtilityCode
public function _escape_and_implode(string $glue, array $values, $single_term = TRUE, string $search_api_field_name = NULL) {
$escaped_values = [];
foreach ($values as $value) {
$escaped_values[] = $this
->_escaped_value($value, $single_term, $search_api_field_name);
}
return implode($glue, $escaped_values);
}