class SearchApiSavedSearchesSettingsI18nStringObjectWrapper in Search API Saved Searches 7
Custom i18n object wrapper.
Hierarchy
- class \i18n_object_wrapper
Expanded class hierarchy of SearchApiSavedSearchesSettingsI18nStringObjectWrapper
1 string reference to 'SearchApiSavedSearchesSettingsI18nStringObjectWrapper'
- SearchApiSavedSearchesSettingsI18nController::hook_object_info in search_api_saved_searches_i18n/
search_api_saved_searches_i18n.controller.inc - Overriddes EntityDefaultI18nStringController::hook_object_info() to include a custom object wrapper.
File
- search_api_saved_searches_i18n/
search_api_saved_searches_i18n.string_wrapper.inc, line 11 - Contains the SearchApiSavedSearchesSettingsI18nStringObjectWrapper class.
View source
class SearchApiSavedSearchesSettingsI18nStringObjectWrapper extends i18n_string_object_wrapper {
/**
* Overrides i18n_string_object_wrapper::get_field() to read properties from the options array.
*/
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);
}
/**
* Get translatable properties
*/
protected function build_properties() {
$strings = parent::build_properties();
$properties = array();
// Dynamically add interval options.
foreach ($this->object->options['interval_options'] as $key => $value) {
$properties['interval_options.' . $key] = array(
'title' => t('Interval option, @key', array(
'@key' => $key,
)),
'string' => $value,
);
}
$strings[$this
->get_textgroup()]['search_api_saved_searches_settings'][$this->object->delta] += $properties;
return $strings;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
protected | property | ||
i18n_object_wrapper:: |
function | Get edit path for object | 2 | |
i18n_object_wrapper:: |
function | Get string numeric key for indexing. | ||
i18n_object_wrapper:: |
public | function | Get object info | |
i18n_object_wrapper:: |
function | Get key value from object/array | ||
i18n_object_wrapper:: |
public | function | Get language code | |
i18n_object_wrapper:: |
public | function | Get real object or array. | |
i18n_object_wrapper:: |
public | function | Get link for item | 2 |
i18n_object_wrapper:: |
protected | function | Get menu placehoders for object | |
i18n_object_wrapper:: |
public | function | Get object string translation info | |
i18n_object_wrapper:: |
public | function | Get title from item | 2 |
i18n_object_wrapper:: |
function | Menu access callback for mixed translation tab | ||
i18n_object_wrapper:: |
public | function | Get object translation set info | |
i18n_object_wrapper:: |
function | Get translation set id if any | ||
i18n_object_wrapper:: |
public | function | Get object type | |
i18n_object_wrapper:: |
function | Load real object or array. | 1 | |
i18n_object_wrapper:: |
function | Localize object if localizable. | ||
i18n_object_wrapper:: |
protected | function | Replace path with placeholders | |
i18n_object_wrapper:: |
function | Set field value to object/array | ||
i18n_object_wrapper:: |
function | Set translation set id | ||
i18n_object_wrapper:: |
protected | function | Translate access (translation sets) | 2 |
i18n_object_wrapper:: |
public | function | Class constructor | 2 |
i18n_string_object_wrapper:: |
protected | property | ||
i18n_string_object_wrapper:: |
protected | property | ||
i18n_string_object_wrapper:: |
public | function | Get object translatable properties | |
i18n_string_object_wrapper:: |
public | function | Get object strings for translation | |
i18n_string_object_wrapper:: |
public | function | Get string context | 3 |
i18n_string_object_wrapper:: |
public | function | Get textgroup name | |
i18n_string_object_wrapper:: |
protected | function | Context to be pre-loaded before translation. | 2 |
i18n_string_object_wrapper:: |
public | function |
Translation mode for object Overrides i18n_object_wrapper:: |
3 |
i18n_string_object_wrapper:: |
public | function | Get translate path for object | 2 |
i18n_string_object_wrapper:: |
public | function | Load all existing strings for this object. | |
i18n_string_object_wrapper:: |
protected | function |
Translate access (localize strings) Overrides i18n_object_wrapper:: |
|
i18n_string_object_wrapper:: |
public | function | Remove all strings for this object. | |
i18n_string_object_wrapper:: |
public | function | Update all strings for this object. | |
i18n_string_object_wrapper:: |
protected | function | Get textgroup object | |
i18n_string_object_wrapper:: |
public | function |
Translate object. Overrides i18n_object_wrapper:: |
|
i18n_string_object_wrapper:: |
protected | function | Translate object property. | 2 |
i18n_string_object_wrapper:: |
protected | function | Translate all properties for object. | |
SearchApiSavedSearchesSettingsI18nStringObjectWrapper:: |
protected | function |
Get translatable properties Overrides i18n_string_object_wrapper:: |
|
SearchApiSavedSearchesSettingsI18nStringObjectWrapper:: |
public | function |
Overrides i18n_string_object_wrapper::get_field() to read properties from the options array. Overrides i18n_object_wrapper:: |