You are here

function GlobalTemplateCollectionManager::importFromGlobalCollection in Courier 8

Same name and namespace in other branches
  1. 2.x src/Service/GlobalTemplateCollectionManager.php \Drupal\courier\Service\GlobalTemplateCollectionManager::importFromGlobalCollection()

Imports active configuration from a global template collection into a template entity at runtime.

This will override message values from the database.

Parameters

\Drupal\courier\ChannelInterface $template: A template entity.

Overrides GlobalTemplateCollectionManagerInterface::importFromGlobalCollection

File

src/Service/GlobalTemplateCollectionManager.php, line 148

Class

GlobalTemplateCollectionManager
The global template collection manager.

Namespace

Drupal\courier\Service

Code

function importFromGlobalCollection(ChannelInterface $template) {
  $gtc = $this
    ->getGlobalCollectionForTemplate($template);
  if ($gtc) {
    $content = $gtc
      ->getTemplate($template
      ->getEntityTypeId());
    if (isset($content)) {
      $template
        ->importTemplate($content);
    }
  }
}