Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
markWebhookEventFailed example
return
;
}
$message
=
$event
->
getEnvelope
(
)
->
getMessage
(
)
;
if
(
!
$message
instanceof WebhookEventMessage
)
{
return
;
}
$webhookId
=
$message
->
getWebhookId
(
)
;
$webhookEventLogId
=
$message
->
getWebhookEventId
(
)
;
$this
->
markWebhookEventFailed
(
$webhookEventLogId
)
;
/** @var WebhookEntity|null $webhook */
$webhook
=
$this
->webhookRepository
->
search
(
new
Criteria
(
[
$webhookId
]
)
, Context::
createDefaultContext
(
)
)
->
get
(
$webhookId
)
;
if
(
$webhook
=== null || !
$webhook
->
isActive
(
)
)
{
return
;
}
$webhookErrorCount
=
$webhook
->
getErrorCount
(
)
+ 1;