devel_wizard-2.x-dev/src/Plugin/DevelWizard/Spell/TaxonomyVocabularyMigrationSpell.php

src/Plugin/DevelWizard/Spell/TaxonomyVocabularyMigrationSpell.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_taxonomy_vocabulary_migration',
  category: new TranslatableMarkup('Taxonomy vocabulary'),
  label: new TranslatableMarkup('Taxonomy vocabulary - Migration'),
  description: new TranslatableMarkup('Creates migration definitions and data sources for an existing Taxonomy vocabulary.'),
  tags: [
    'bundle' => new TranslatableMarkup('Bundle'),
    'config_entity' => new TranslatableMarkup('Config entity'),
    'taxonomy_vocabulary' => new TranslatableMarkup('Taxonomy vocabulary'),
    'migration' => new TranslatableMarkup('Migration'),
  ],
)]
class TaxonomyVocabularyMigrationSpell extends ConfigEntityMigrationSpellBase {

  protected string $provider = 'taxonomy';

  protected string $configEntityTypeId = 'taxonomy_vocabulary';

  protected string $contentEntityTypeId = 'taxonomy_term';

  protected function getMigrationSourceData(): array {
    return [
      'foo' => [
        'uuid' => $this->uuid->generate(),
        'name' => 'Foo',
        'description' => 'My foo description.',
      ],
    ];
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc