You are here

interface GlobalTemplateCollectionManagerInterface in Courier 2.x

Same name and namespace in other branches
  1. 8 src/Service/GlobalTemplateCollectionManagerInterface.php \Drupal\courier\Service\GlobalTemplateCollectionManagerInterface

Interface for the global template collection manager.

Hierarchy

Expanded class hierarchy of GlobalTemplateCollectionManagerInterface

All classes that implement GlobalTemplateCollectionManagerInterface

File

src/Service/GlobalTemplateCollectionManagerInterface.php, line 12

Namespace

Drupal\courier\Service
View source
interface GlobalTemplateCollectionManagerInterface {

  /**
   * Get the global template collection associated with a template.
   *
   * @param \Drupal\courier\ChannelInterface $template
   *   A template entity.
   *
   * @return \Drupal\courier\Entity\GlobalTemplateCollectionInterface|false
   *   A global template collection entity, or FALSE if the template is not
   *   associated with a global template collection.
   */
  public function getGlobalCollectionForTemplate(ChannelInterface $template);

  /**
   * Gets the global collection for a local collection.
   *
   * Get the global template collection associated with a local template
   * collection.
   *
   * @param \Drupal\courier\TemplateCollectionInterface $template_collection
   *   A local template collection entity.
   *
   * @return \Drupal\courier\Entity\GlobalTemplateCollectionInterface|false
   *   A global template collection entity, or FALSE if the template collection
   *   is not associated with a global template collection.
   */
  public function getGlobalCollectionForLocalCollection(TemplateCollectionInterface $template_collection);

  /**
   * Create a global template collection and associate it with a template
   * collection.
   *
   * @param \Drupal\courier\TemplateCollectionInterface $template_collection
   *   A local template collection entity.
   * @param array $defaults
   *   Default values to add to the new global template collection. This value
   *   must contain a 'id' key which does not conflict with existing global
   *   template collections.
   *
   * @return \Drupal\courier\Entity\GlobalTemplateCollectionInterface
   *   A new and saved global template collection.
   *
   * @throws \Drupal\courier\Exception\GlobalTemplateCollectionException
   *   Thrown if passed template collection is unsaved.
   */
  public function createGlobalCollectionForLocalCollection(TemplateCollectionInterface $template_collection, array $defaults = []);

  /**
   * Create a global collection and associate it with a template collection.
   *
   * Create a global template collection and associate it with a template
   * collection.
   *
   * @param \Drupal\courier\Entity\GlobalTemplateCollectionInterface $global_template_collection
   *   A global template collection entity.
   *
   * @return \Drupal\courier\TemplateCollectionInterface
   *   A template collection entity.
   *
   * @throws \Drupal\courier\Exception\GlobalTemplateCollectionException
   *   Thrown if passed global template collection is unsaved.
   */
  public function createLocalCollectionForGlobalCollection(GlobalTemplateCollectionInterface $global_template_collection);

  /**
   * Locate, and optionally instantiate, a local template collection to
   * associate a global template collection.
   *
   * @param \Drupal\courier\Entity\GlobalTemplateCollectionInterface $global_template_collection
   *   A global template collection entity.
   *
   * @return \Drupal\courier\TemplateCollectionInterface
   *   A template collection entity.
   *
   * @throws \Drupal\courier\Exception\GlobalTemplateCollectionException
   *   Thrown if passed global template collection is unsaved.
   */
  public function getLocalCollection(GlobalTemplateCollectionInterface $global_template_collection);

  /**
   * Notify the manager that a template entity has been saved.
   *
   * This method will resynchronise template contents with the global template
   * collection configuration.
   *
   * @param \Drupal\courier\ChannelInterface $template
   *   A template entity.
   */
  public function notifyTemplateChanged(ChannelInterface $template);

  /**
   * Imports active configuration from a global template collection into
   * a template entity at runtime.
   *
   * This will override message values from the database.
   *
   * @param \Drupal\courier\ChannelInterface $template
   *   A template entity.
   */
  public function importFromGlobalCollection(ChannelInterface $template);

}

Members

Namesort descending Modifiers Type Description Overrides
GlobalTemplateCollectionManagerInterface::createGlobalCollectionForLocalCollection public function Create a global template collection and associate it with a template collection. 1
GlobalTemplateCollectionManagerInterface::createLocalCollectionForGlobalCollection public function Create a global collection and associate it with a template collection. 1
GlobalTemplateCollectionManagerInterface::getGlobalCollectionForLocalCollection public function Gets the global collection for a local collection. 1
GlobalTemplateCollectionManagerInterface::getGlobalCollectionForTemplate public function Get the global template collection associated with a template. 1
GlobalTemplateCollectionManagerInterface::getLocalCollection public function Locate, and optionally instantiate, a local template collection to associate a global template collection. 1
GlobalTemplateCollectionManagerInterface::importFromGlobalCollection public function Imports active configuration from a global template collection into a template entity at runtime. 1
GlobalTemplateCollectionManagerInterface::notifyTemplateChanged public function Notify the manager that a template entity has been saved. 1