You are here

public function JuicerEmbedFeedBlockDerivative::getDerivativeDefinitions in Juicer - Social Media Feed Aggregator 8

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Derivative/JuicerEmbedFeedBlockDerivative.php, line 55
Contains \Drupal\juicerio\src\Plugin\Derivative\JuicerEmbedFeedBlockDerivative.

Class

JuicerEmbedFeedBlockDerivative
Class JuicerEmbedFeedBlockDerivative.

Namespace

Drupal\juicerio\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $count = $this->configFactory
    ->get('juicerio.settings')
    ->get('juicer_blocks');
  for ($delta = 1; $delta <= $count; $delta++) {
    $info = $this
      ->t('Juicer Embed Feed');
    $this->derivatives['juicerio_' . $delta] = $base_plugin_definition;
    $this->derivatives['juicerio_' . $delta]['admin_label'] = $this
      ->t('@info @delta', [
      '@info' => $info,
      '@delta' => $delta,
    ]);
  }
  return $this->derivatives;
}