You are here

public function PagererPresetListBuilder::listOptions in Pagerer 8

Same name and namespace in other branches
  1. 8.2 src/PagererPresetListBuilder.php \Drupal\pagerer\PagererPresetListBuilder::listOptions()

Create a list of presets suitable for selection.

File

src/PagererPresetListBuilder.php, line 56

Class

PagererPresetListBuilder
Provides a listing of Pagerer presets.

Namespace

Drupal\pagerer

Code

public function listOptions() {
  $entities = $this
    ->load();
  $list = [];
  if ($entities) {
    foreach ($entities as $preset) {
      $list[$preset
        ->id()] = $preset
        ->label();
    }
  }
  return $list;
}