You are here

public function SearchApiSavedSearchesSettingsI18nStringObjectWrapper::get_field in Search API Saved Searches 7

Overrides i18n_string_object_wrapper::get_field() to read properties from the options array.

Overrides i18n_object_wrapper::get_field

File

search_api_saved_searches_i18n/search_api_saved_searches_i18n.string_wrapper.inc, line 16
Contains the SearchApiSavedSearchesSettingsI18nStringObjectWrapper class.

Class

SearchApiSavedSearchesSettingsI18nStringObjectWrapper
Custom i18n object wrapper.

Code

public function get_field($field, $default = NULL) {
  if (strpos($field, '.') !== FALSE) {
    $value = drupal_array_get_nested_value($this->object->options, explode('.', $field));
    if (isset($value)) {
      return $value;
    }
  }
  if (isset($this->object->options[$field])) {
    return $this->object->options[$field];
  }

  // Fallback to the usual behaviour.
  return parent::get_field($field, $default);
}