Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

TargetBundle.php

Namespace

Drupal\taxonomy\Plugin\migrate\process

File

core/modules/taxonomy/src/Plugin/migrate/process/TargetBundle.php

View source
<?php

namespace Drupal\taxonomy\Plugin\migrate\process;

use Drupal\migrate\Attribute\MigrateProcess;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;

/**
 * Converts a Drupal 6 vocabulary ID to a target bundle array.
 */
class TargetBundle extends ProcessPluginBase {
    
    /**
     * {@inheritdoc}
     */
    public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
        $target_bundle = [];
        $vid = $row->get('@_vid');
        $target_bundle[$vid] = $vid;
        return $target_bundle;
    }

}

Classes

Title Deprecated Summary
TargetBundle Converts a Drupal 6 vocabulary ID to a target bundle array.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal