You are here

public function ParagraphsSliderPlugin::getAllOptionSet in Paragraphs Collection 8

Returns an array of all available slider options.

Return value

array All available optionsets, e.g. ['machine_name' => 'Label'].

4 calls to ParagraphsSliderPlugin::getAllOptionSet()
ParagraphsSliderPlugin::buildBehaviorForm in modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsSliderPlugin.php
Builds a behavior perspective for each paragraph based on its type.
ParagraphsSliderPlugin::buildConfigurationForm in modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsSliderPlugin.php
Form constructor.
ParagraphsSliderPlugin::settingsSummary in modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsSliderPlugin.php
Returns a short summary for the current behavior settings.
ParagraphsSliderPlugin::submitConfigurationForm in modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsSliderPlugin.php
Form submission handler.

File

modules/paragraphs_collection_demo/src/Plugin/paragraphs/Behavior/ParagraphsSliderPlugin.php, line 267

Class

ParagraphsSliderPlugin
Provides Slider plugin.

Namespace

Drupal\paragraphs_collection_demo\Plugin\paragraphs\Behavior

Code

public function getAllOptionSet() {

  /** @var \Drupal\slick\Entity\Slick[] $entities */
  $entities = $this->slickManager
    ->entityLoadMultiple('slick');
  $option_sets = [];
  foreach ($entities as $options_set_id => $option_set) {
    $option_sets[$option_set
      ->id()] = $option_set
      ->label();
  }
  return $option_sets;
}