SliderProManager.php in Slider Pro 8
File
src/Manager/SliderProManager.php
View source
<?php
namespace Drupal\slider_pro\Manager;
use Drupal\slider_pro\Entity\SliderPro;
class SliderProManager {
public function getOptionList() {
$optionsets = SliderPro::loadMultiple();
$options = [];
foreach ($optionsets as $name => $optionset) {
$options[$name] = $optionset
->label();
}
if (empty($options)) {
$options[''] = t('No defined option sets');
}
return $options;
}
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;
}
}