Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92714826
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
Sat, Nov 23, 01:36
Size
658 B
Mime Type
text/x-php
Expires
Mon, Nov 25, 01:36 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22494637
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