You are here

HookFieldAttachRenameBundle.php in Drupal 7 to 8/9 Module Upgrader 8

File

src/Plugin/DMU/Converter/HookFieldAttachRenameBundle.php
View source
<?php

namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter;

use Drupal\drupalmoduleupgrader\ConverterBase;
use Drupal\drupalmoduleupgrader\TargetInterface;

/**
 * @Converter(
 *  id = "hook_field_attach_rename_bundle",
 *  description = @Translation("Renames hook_field_attach_rename_bundle()."),
 *  hook = "hook_field_attach_rename_bundle"
 * )
 */
class HookFieldAttachRenameBundle extends ConverterBase {

  /**
   * {@inheritdoc}
   */
  public function convert(TargetInterface $target) {
    $hook = $target
      ->getIndexer('function')
      ->get($this->pluginDefinition['hook'])
      ->setName($target
      ->id() . '_entity_bundle_rename');
    $target
      ->save($hook);
  }

}

Classes

Namesort descending Description
HookFieldAttachRenameBundle Plugin annotation @Converter( id = "hook_field_attach_rename_bundle", description = @Translation("Renames hook_field_attach_rename_bundle()."), hook = "hook_field_attach_rename_bundle" )