You are here

function shs_term_get_parents in Simple hierarchical select 8

Load parents for default values.

Parameters

array $default_values: List of default values of the widget.

array $settings: Widget settings.

Return value

array List of parents for each default value.

Deprecated

since version 8.x-1.0-alpha2+1-dev This function has been replaced by service 'shs.widget_defaults' and will be removed in version 8.x-1.1.

File

./shs.module, line 68
Main functions and methods for the "Simple hierarchical select" module.

Code

function shs_term_get_parents(array $default_values, array $settings, $target_type) {

  /** @var Drupal\shs\WidgetDefaultsInterface $widget_defaults */
  $widget_defaults = \Drupal::service('shs.widget_defaults');
  return $widget_defaults
    ->getParentDefaults($default_values, $settings['any_value'], $target_type);
}