class JuicerEmbedFeedBlockDerivative in Juicer - Social Media Feed Aggregator 8
Class JuicerEmbedFeedBlockDerivative.
@package Drupal\juicerio\Plugin\Derivative.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\juicerio\Plugin\Derivative\JuicerEmbedFeedBlockDerivative implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of JuicerEmbedFeedBlockDerivative
File
- src/
Plugin/ Derivative/ JuicerEmbedFeedBlockDerivative.php, line 21 - Contains \Drupal\juicerio\src\Plugin\Derivative\JuicerEmbedFeedBlockDerivative.
Namespace
Drupal\juicerio\Plugin\DerivativeView source
class JuicerEmbedFeedBlockDerivative extends DeriverBase implements ContainerDeriverInterface {
use StringTranslationTrait;
/**
* The Drupal config factory service.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a global locator.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The Drupal config factory service.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('config.factory'));
}
/**
* {@inheritdoc}
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
JuicerEmbedFeedBlockDerivative:: |
protected | property | The Drupal config factory service. | |
JuicerEmbedFeedBlockDerivative:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
JuicerEmbedFeedBlockDerivative:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
JuicerEmbedFeedBlockDerivative:: |
public | function | Constructs a global locator. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |