Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96462457
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
Thu, Dec 26, 23:43
Size
658 B
Mime Type
text/x-php
Expires
Sat, Dec 28, 23:43 (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
23172210
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