You are here

function courier_entity_load in Courier 2.x

Same name and namespace in other branches
  1. 8 courier.module \courier_entity_load()

Implements hook_entity_load().

File

./courier.module, line 45
Hooks for Courier.

Code

function courier_entity_load($entities, $entity_type) {
  if (!reset($entities) instanceof ChannelInterface) {
    return;
  }

  /** @var \Drupal\courier\Service\GlobalTemplateCollectionManagerInterface $template_collection_manager */
  $template_collection_manager = \Drupal::service('courier.manager.global_template_collection');
  foreach ($entities as $entity) {
    $template_collection_manager
      ->importFromGlobalCollection($entity);
  }
}