protected function LayoutBuilderAtBase::setupBlockType in Layout Builder Asymmetric Translation 8.2
Create a block content type.
Parameters
$label:
bool $create_body:
Throws
\Drupal\Core\Entity\EntityStorageException
1 call to LayoutBuilderAtBase::setupBlockType()
- LayoutBuilderAtReplicateTest::setUp in tests/
src/ Functional/ LayoutBuilderAtReplicateTest.php
File
- tests/
src/ Functional/ LayoutBuilderAtBase.php, line 111
Class
- LayoutBuilderAtBase
- Base class for Layout Builder Asymmetric Translations.
Namespace
Drupal\Tests\layout_builder_at\FunctionalCode
protected function setupBlockType($label, $create_body = TRUE) {
$bundle = BlockContentType::create([
'id' => $label,
'label' => $label,
'revision' => FALSE,
]);
$bundle
->save();
if ($create_body) {
block_content_add_body_field($bundle
->id());
}
}