You are here

public function InstallHelper::importContent in Drupal 9

Same name and namespace in other branches
  1. 8 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()

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 133

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');
}