Added option to send orphan visits to webhooks

This commit is contained in:
Alejandro Celaya
2021-10-09 10:53:21 +02:00
parent c718b94937
commit d16fda3f16
8 changed files with 102 additions and 15 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Options;
use Laminas\Stdlib\AbstractOptions;
class WebhookOptions extends AbstractOptions
{
protected $__strictMode__ = false; // phpcs:ignore
private array $visitsWebhooks = [];
private bool $notifyOrphanVisitsToWebhooks = false;
public function webhooks(): array
{
return $this->visitsWebhooks;
}
public function hasWebhooks(): bool
{
return ! empty($this->visitsWebhooks);
}
protected function setVisitsWebhooks(array $visitsWebhooks): void
{
$this->visitsWebhooks = $visitsWebhooks;
}
public function notifyOrphanVisits(): bool
{
return $this->notifyOrphanVisitsToWebhooks;
}
protected function setNotifyOrphanVisitsToWebhooks(bool $notifyOrphanVisitsToWebhooks): void
{
$this->notifyOrphanVisitsToWebhooks = $notifyOrphanVisitsToWebhooks;
}
}