Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93206549
PhabricatorTokenDestructionEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 27, 00:42
Size
658 B
Mime Type
text/x-php
Expires
Fri, Nov 29, 00:42 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
22592652
Attached To
rPH Phabricator
PhabricatorTokenDestructionEngineExtension.php
View Options
<?php
final
class
PhabricatorTokenDestructionEngineExtension
extends
PhabricatorDestructionEngineExtension
{
const
EXTENSIONKEY
=
'tokens'
;
public
function
getExtensionName
()
{
return
pht
(
'Tokens'
);
}
public
function
canDestroyObject
(
PhabricatorDestructionEngine
$engine
,
$object
)
{
return
(
$object
instanceof
PhabricatorTokenReceiverInterface
);
}
public
function
destroyObject
(
PhabricatorDestructionEngine
$engine
,
$object
)
{
$tokens
=
id
(
new
PhabricatorTokenGiven
())->
loadAllWhere
(
'objectPHID = %s'
,
$object
->
getPHID
());
foreach
(
$tokens
as
$token
)
{
$token
->
delete
();
}
}
}
Event Timeline
Log In to Comment