You are here

public function GlobalTemplateCollectionManager::getGlobalCollectionForTemplate in Courier 2.x

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

Get the global template collection associated with a template.

Parameters

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

Return value

\Drupal\courier\Entity\GlobalTemplateCollectionInterface|false A global template collection entity, or FALSE if the template is not associated with a global template collection.

Overrides GlobalTemplateCollectionManagerInterface::getGlobalCollectionForTemplate

2 calls to GlobalTemplateCollectionManager::getGlobalCollectionForTemplate()
GlobalTemplateCollectionManager::importFromGlobalCollection in src/Service/GlobalTemplateCollectionManager.php
Imports active configuration from a global template collection into a template entity at runtime.
GlobalTemplateCollectionManager::notifyTemplateChanged in src/Service/GlobalTemplateCollectionManager.php
Notify the manager that a template entity has been saved.

File

src/Service/GlobalTemplateCollectionManager.php, line 48

Class

GlobalTemplateCollectionManager
The global template collection manager.

Namespace

Drupal\courier\Service

Code

public function getGlobalCollectionForTemplate(ChannelInterface $template) {
  $template_collection = TemplateCollection::getTemplateCollectionForTemplate($template);
  if ($template_collection) {
    return $this
      ->getGlobalCollectionForLocalCollection($template_collection);
  }
  return FALSE;
}