You are here

protected function Query::sanitizeOptions in Search API 8

Sanitizes an array of options in a way that plays nice with var_export().

Parameters

array $options: An array of options.

Return value

array The sanitized options.

1 call to Query::sanitizeOptions()
Query::__toString in src/Query/Query.php
Implements the magic __toString() method to simplify debugging.

File

src/Query/Query.php, line 868

Class

Query
Provides a standard implementation for a Search API query.

Namespace

Drupal\search_api\Query

Code

protected function sanitizeOptions(array $options) {
  foreach ($options as $key => $value) {
    if (is_object($value)) {
      $options[$key] = 'object (' . get_class($value) . ')';
    }
    elseif (is_array($value)) {
      $options[$key] = $this
        ->sanitizeOptions($value);
    }
  }
  return $options;
}