Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F600660
HeraldWebhookStatusTransaction.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
HeraldWebhookStatusTransaction.php
View Options
<?php
final
class
HeraldWebhookStatusTransaction
extends
HeraldWebhookTransactionType
{
const
TRANSACTIONTYPE
=
'status'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getStatus
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setStatus
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s changed hook status from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s changed %s from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
$viewer
=
$this
->
getActor
();
$options
=
HeraldWebhook
::
getStatusDisplayNameMap
();
foreach
(
$xactions
as
$xaction
)
{
$new_value
=
$xaction
->
getNewValue
();
if
(!
isset
(
$options
[
$new_value
]))
{
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'Webhook status "%s" is not valid. Valid statuses are: %s.'
,
$new_value
,
implode
(
', '
,
array_keys
(
$options
))),
$xaction
);
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 14, 5:22 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
131080
Default Alt Text
HeraldWebhookStatusTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment