You are here

interface WebhookDispatcherInterface in Webhooks 8

Webhook dispatchers control triggering outbound webhook events.

@package Drupal\webhooks

Hierarchy

Expanded class hierarchy of WebhookDispatcherInterface

All classes that implement WebhookDispatcherInterface

File

src/WebhookDispatcherInterface.php, line 12

Namespace

Drupal\webhooks
View source
interface WebhookDispatcherInterface {

  /**
   * Load multiple WebhookConfigs by event.
   *
   * @param string $event
   *   An event string in the form of entity:entity_type:action,
   *   e.g. 'entity:user:create', 'entity:user:update' or 'entity:user:delete'.
   * @param string $type
   *   A type string, e.g. 'outgoing' or 'incoming'.
   *
   * @return \Drupal\webhooks\Entity\WebhookConfigInterface[]
   *   An array of WebhookConfig entities.
   */
  public function loadMultipleByEvent($event, $type = 'outgoing');

  /**
   * Trigger all webhook subscriptions associated with the given event.
   *
   * @param \Drupal\webhooks\Webhook $webhook
   *   The webhook object.
   * @param string $event
   *   Identifier of a particular webhook event, e.g. entity:node:create,
   *   entity:user:update or entity:taxonomy_term:delete.
   */
  public function triggerEvent(Webhook $webhook, $event);

  /**
   * Send a webhook.
   *
   * @param \Drupal\webhooks\Entity\WebhookConfig $webhook_config
   *   A webhook config entity.
   * @param \Drupal\webhooks\Webhook $webhook
   *   A webhook object.
   */
  public function send(WebhookConfig $webhook_config, Webhook $webhook);

}

Members

Namesort descending Modifiers Type Description Overrides
WebhookDispatcherInterface::loadMultipleByEvent public function Load multiple WebhookConfigs by event. 1
WebhookDispatcherInterface::send public function Send a webhook. 1
WebhookDispatcherInterface::triggerEvent public function Trigger all webhook subscriptions associated with the given event. 1