You are here

function wysiwyg_template_update_8002 in Wysiwyg API template plugin 3.0.x

Migrate node types into entity types.

File

./wysiwyg_template.install, line 20

Code

function wysiwyg_template_update_8002() {

  /** @var \Drupal\wysiwyg_template_core\TemplateInterface $template */
  foreach (Template::loadMultiple() as $template) {
    if (empty($template
      ->getBundles())) {
      $template
        ->setBundles('node', $template
        ->getNodeTypes())
        ->save();
    }
  }
}