class MailchimpSignupSubscribeBlock in Mailchimp 8
Same name in this branch
- 8 modules/mailchimp_signup/src/Plugin/Derivative/MailchimpSignupSubscribeBlock.php \Drupal\mailchimp_signup\Plugin\Derivative\MailchimpSignupSubscribeBlock
- 8 modules/mailchimp_signup/src/Plugin/Block/MailchimpSignupSubscribeBlock.php \Drupal\mailchimp_signup\Plugin\Block\MailchimpSignupSubscribeBlock
Same name and namespace in other branches
- 2.x modules/mailchimp_signup/src/Plugin/Derivative/MailchimpSignupSubscribeBlock.php \Drupal\mailchimp_signup\Plugin\Derivative\MailchimpSignupSubscribeBlock
Provides block plugin definitions for Mailchimp Signup blocks.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\mailchimp_signup\Plugin\Derivative\MailchimpSignupSubscribeBlock uses StringTranslationTrait
Expanded class hierarchy of MailchimpSignupSubscribeBlock
See also
\Drupal\mailchimp_signup\Plugin\Block\MailchimpSignupSubscribeBlock
File
- modules/
mailchimp_signup/ src/ Plugin/ Derivative/ MailchimpSignupSubscribeBlock.php, line 13
Namespace
Drupal\mailchimp_signup\Plugin\DerivativeView source
class MailchimpSignupSubscribeBlock extends DeriverBase {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$signups = mailchimp_signup_load_multiple();
/* @var $signup \Drupal\mailchimp_signup\Entity\MailchimpSignup */
foreach ($signups as $signup) {
if (intval($signup->mode) == MAILCHIMP_SIGNUP_BLOCK || intval($signup->mode) == MAILCHIMP_SIGNUP_BOTH) {
$this->derivatives[$signup->id] = $base_plugin_definition;
$this->derivatives[$signup->id]['admin_label'] = $this
->t('Mailchimp Subscription Form: @name', [
'@name' => $signup
->label(),
]);
}
}
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:: |
|
MailchimpSignupSubscribeBlock:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
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. |