function InstallHelper::importContent

Same name in other branches
  1. 9 core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::importContent()
  2. 10 core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::importContent()
  3. 11.x core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::importContent()

Imports default contents.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

\Drupal\Core\Entity\EntityStorageException

File

core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php, line 145

Class

InstallHelper
Defines a helper class for importing default content.

Namespace

Drupal\demo_umami_content

Code

public function importContent() {
    $this->getModulePath()
        ->importEditors()
        ->importContentFromFile('taxonomy_term', 'tags')
        ->importContentFromFile('taxonomy_term', 'recipe_category')
        ->importContentFromFile('media', 'image')
        ->importContentFromFile('node', 'recipe')
        ->importContentFromFile('node', 'article')
        ->importContentFromFile('node', 'page')
        ->importContentFromFile('block_content', 'disclaimer_block')
        ->importContentFromFile('block_content', 'footer_promo_block')
        ->importContentFromFile('block_content', 'banner_block');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.