Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96363069
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, Dec 25, 22:43
Size
658 B
Mime Type
text/x-php
Expires
Fri, Dec 27, 22:43 (2 d)
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