function GlobalTemplateCollectionManager::notifyTemplateChanged in Courier 8
Same name and namespace in other branches
- 2.x src/Service/GlobalTemplateCollectionManager.php \Drupal\courier\Service\GlobalTemplateCollectionManager::notifyTemplateChanged()
Notify the manager that a template entity has been saved.
This method will resynchronise template contents with the global template collection configuration.
Parameters
\Drupal\courier\ChannelInterface $template: A template entity.
Overrides GlobalTemplateCollectionManagerInterface::notifyTemplateChanged
File
- src/Service/ GlobalTemplateCollectionManager.php, line 136 
Class
- GlobalTemplateCollectionManager
- The global template collection manager.
Namespace
Drupal\courier\ServiceCode
function notifyTemplateChanged(ChannelInterface $template) {
  $gtc = $this
    ->getGlobalCollectionForTemplate($template);
  if ($gtc) {
    $contents = $template
      ->exportTemplate();
    $gtc
      ->setTemplate($template
      ->getEntityTypeId(), $contents);
    $gtc
      ->save();
  }
}