class SliderProManager in Slider Pro 8
Class SliderProManager @package Drupal\slider_pro\Manager
Hierarchy
- class \Drupal\slider_pro\Manager\SliderProManager
Expanded class hierarchy of SliderProManager
2 files declare their use of SliderProManager
- SliderPro.php in src/
Plugin/ views/ style/ SliderPro.php - SliderProFormatter.php in src/
Plugin/ Field/ FieldFormatter/ SliderProFormatter.php
1 string reference to 'SliderProManager'
1 service uses SliderProManager
File
- src/
Manager/ SliderProManager.php, line 11
Namespace
Drupal\slider_pro\ManagerView source
class SliderProManager {
/**
* returns array of option sets suitable for using as select list options.
* @return array
*/
public function getOptionList() {
$optionsets = SliderPro::loadMultiple();
$options = [];
foreach ($optionsets as $name => $optionset) {
/** @var \Drupal\slider_pro\Entity\SliderProInterface $optionset */
$options[$name] = $optionset
->label();
}
if (empty($options)) {
$options[''] = t('No defined option sets');
}
return $options;
}
/**
* Flatten array and preserve keys.
* @param array $array
* @return array
*/
public static function flattenArray(array $array) {
$flattened_array = array();
array_walk_recursive($array, function ($a, $key) use (&$flattened_array) {
$flattened_array[$key] = $a;
});
return $flattened_array;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SliderProManager:: |
public static | function | Flatten array and preserve keys. | |
SliderProManager:: |
public | function | returns array of option sets suitable for using as select list options. |