public function FormEntityHelperTrait::getBlockContentBundle in Block Style Plugins 8.2
Get the block content bundle type.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The current form state.
Return value
string Name of the Block Content bundle.
1 call to FormEntityHelperTrait::getBlockContentBundle()
- BlockFormAlter::alterForm in src/
BlockFormAlter.php - Alter a form and set block configuration.
File
- src/
FormEntityHelperTrait.php, line 45
Class
- FormEntityHelperTrait
- Provides a helper for getting information from the entity being styled.
Namespace
Drupal\block_style_pluginsCode
public function getBlockContentBundle(FormStateInterface $form_state) {
$bundle = NULL;
// Get the current block config entity.
$block_content = $this
->getBlockContent($form_state);
if ($block_content) {
$bundle = $block_content
->bundle();
}
return $bundle;
}