devel_wizard-2.x-dev/src/Plugin/DevelWizard/Spell/BlockContentTypeMigrationSpell.php
src/Plugin/DevelWizard/Spell/BlockContentTypeMigrationSpell.php
<?php
declare(strict_types=1);
namespace Drupal\devel_wizard\Plugin\DevelWizard\Spell;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\devel_wizard\Attribute\DevelWizardSpell;
#[DevelWizardSpell(
id: 'devel_wizard_block_content_type_migration',
category: new TranslatableMarkup('Block type'),
label: new TranslatableMarkup('Block type - Migration'),
description: new TranslatableMarkup('Creates migration definitions and data sources for an existing Block type.'),
tags: [
'bundle' => new TranslatableMarkup('Bundle'),
'config_entity' => new TranslatableMarkup('Config entity'),
'block_content_type' => new TranslatableMarkup('Block type'),
'migration' => new TranslatableMarkup('Migration'),
],
)]
class BlockContentTypeMigrationSpell extends ConfigEntityMigrationSpellBase {
protected string $provider = 'block_content';
protected string $configEntityTypeId = 'block_content_type';
protected string $contentEntityTypeId = 'block_content';
protected function getMigrationSourceData(): array {
return [
'foo' => [
'uuid' => $this->uuid->generate(),
'status' => 1,
'info' => 'Foo',
'reusable' => TRUE,
],
];
}
}
