class InviteBlock in Invite 8
InviteBlock Class.
Hierarchy
- class \Drupal\invite\Plugin\Derivative\InviteBlock implements DeriverInterface
Expanded class hierarchy of InviteBlock
File
- src/
Plugin/ Derivative/ InviteBlock.php, line 11
Namespace
Drupal\invite\Plugin\DerivativeView source
class InviteBlock implements DeriverInterface {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
$derivatives = $this
->getDerivativeDefinitions($base_plugin_definition);
if (isset($derivatives[$derivative_id])) {
return $derivatives[$derivative_id];
}
}
/**
* Creates a block for each sending method that is enabled on invite_types.
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$derivatives = [];
foreach (InviteSender::loadMultiple(\Drupal::entityQuery('invite_sender')
->condition('sending_methods', $base_plugin_definition['provider'], 'CONTAINS')
->execute()) as $sending_method) {
$sending_method_id = $sending_method
->id();
$derivatives[$sending_method_id] = $base_plugin_definition;
$derivatives[$sending_method_id]['admin_label'] = \Drupal::config('invite.invite_type.' . $sending_method_id)
->get('label');
}
return $derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
InviteBlock:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
InviteBlock:: |
public | function |
Creates a block for each sending method that is enabled on invite_types. Overrides DeriverInterface:: |