Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F474912
HeraldCallWebhookAction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
HeraldCallWebhookAction.php
View Options
<?php
final
class
HeraldCallWebhookAction
extends
HeraldAction
{
const
ACTIONCONST
=
'webhook'
;
const
DO_WEBHOOK
=
'do.call-webhook'
;
public
function
getHeraldActionName
()
{
return
pht
(
'Call webhooks'
);
}
public
function
getActionGroupKey
()
{
return
HeraldUtilityActionGroup
::
ACTIONGROUPKEY
;
}
public
function
supportsObject
(
$object
)
{
if
(!
$this
->
getAdapter
()->
supportsWebhooks
())
{
return
false
;
}
return
true
;
}
public
function
supportsRuleType
(
$rule_type
)
{
return
(
$rule_type
!==
HeraldRuleTypeConfig
::
RULE_TYPE_PERSONAL
);
}
public
function
applyEffect
(
$object
,
HeraldEffect
$effect
)
{
$adapter
=
$this
->
getAdapter
();
$rule
=
$effect
->
getRule
();
$target
=
$effect
->
getTarget
();
foreach
(
$target
as
$webhook_phid
)
{
$adapter
->
queueWebhook
(
$webhook_phid
,
$rule
->
getPHID
());
}
$this
->
logEffect
(
self
::
DO_WEBHOOK
,
$target
);
}
public
function
getHeraldActionStandardType
()
{
return
self
::
STANDARD_PHID_LIST
;
}
protected
function
getActionEffectMap
()
{
return
array
(
self
::
DO_WEBHOOK
=>
array
(
'icon'
=>
'fa-cloud-upload'
,
'color'
=>
'green'
,
'name'
=>
pht
(
'Called Webhooks'
),
),
);
}
public
function
renderActionDescription
(
$value
)
{
return
pht
(
'Call webhooks: %s.'
,
$this
->
renderHandleList
(
$value
));
}
protected
function
renderActionEffectDescription
(
$type
,
$data
)
{
return
pht
(
'Called webhooks: %s.'
,
$this
->
renderHandleList
(
$data
));
}
protected
function
getDatasource
()
{
return
new
HeraldWebhookDatasource
();
}
public
function
getPHIDsAffectedByAction
(
HeraldActionRecord
$record
)
{
return
$record
->
getTarget
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 9:47 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
85020
Default Alt Text
HeraldCallWebhookAction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment