Skip to content
Snippets Groups Projects
Commit 17994a2f authored by Stefan Auditor's avatar Stefan Auditor
Browse files

Issue #3526558 by sanduhrs: Add webhook_type mapping operation

parent 80a5378b
No related branches found
No related tags found
2 merge requests!34Issue #3302284 by sanduhrs, ant1, datawench, vrs11: Add possibility to set up...,!31Issue #3526558 by sanduhrs: Add webhook_type mapping operation
Pipeline #506582 passed
<?php
declare(strict_types=1);
namespace Drupal\webhooks\Hook;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Hook\Attribute\Hook;
use Drupal\Core\Url;
use Drupal\webhook\Entity\WebhookType;
/**
* Hook implementations for webhooks module.
*/
class WebhookHooks {
/**
* Implements hook_entity_operation().
*/
#[Hook('entity_operation')]
public function entityOperation(EntityInterface $entity): array {
$operations = [];
if ($entity instanceof WebhookType) {
$operations['mapping'] = [
'title' => t('Mapping'),
'url' => Url::fromRoute('webhook.webhook_type.field_mapping', ['webhook_type' => $entity->id()]),
'weight' => 50,
];
}
return $operations;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment