You are here

public function Webhook::setEvent in Webhooks 8

Set the event.

Parameters

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'.

Return value

Webhook The webhook.

1 call to Webhook::setEvent()
Webhook::__construct in src/Webhook.php
Webhook constructor.

File

src/Webhook.php, line 230

Class

Webhook
Class Webhook .

Namespace

Drupal\webhooks

Code

public function setEvent($event) {
  $this->event = $event;
  $this
    ->addHeaders([
    'X-Drupal-Event' => $event,
  ]);
  return $this;
}