devel_wizard-2.x-dev/src/Plugin/DevelWizard/Spell/NodeTypeMigrationSpell.php
src/Plugin/DevelWizard/Spell/NodeTypeMigrationSpell.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_node_type_migration',
category: new TranslatableMarkup('Content type'),
label: new TranslatableMarkup('Content type - Migration'),
description: new TranslatableMarkup('Creates migration definitions and data sources for an existing Content type.'),
tags: [
'bundle' => new TranslatableMarkup('Bundle'),
'config_entity' => new TranslatableMarkup('Config entity'),
'node_type' => new TranslatableMarkup('Content type'),
'migration' => new TranslatableMarkup('Migration'),
],
)]
class NodeTypeMigrationSpell extends ConfigEntityMigrationSpellBase {
protected string $provider = 'node';
protected string $configEntityTypeId = 'node_type';
protected string $contentEntityTypeId = 'node';
protected function getMigrationSourceData(): array {
return [
'foo' => [
'title' => $this->random->string(24),
'uuid' => $this->uuid->generate(),
'created' => 'now',
],
];
}
}
