Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1102100
PhabricatorEdgesDestructionEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
904 B
Referenced Files
None
Subscribers
None
PhabricatorEdgesDestructionEngineExtension.php
View Options
<?php
final
class
PhabricatorEdgesDestructionEngineExtension
extends
PhabricatorDestructionEngineExtension
{
const
EXTENSIONKEY
=
'edges'
;
public
function
getExtensionName
()
{
return
pht
(
'Edges'
);
}
public
function
destroyObject
(
PhabricatorDestructionEngine
$engine
,
$object
)
{
$src_phid
=
$object
->
getPHID
();
try
{
$edges
=
id
(
new
PhabricatorEdgeQuery
())
->
withSourcePHIDs
(
array
(
$src_phid
))
->
execute
();
}
catch
(
Exception
$ex
)
{
// This is (presumably) a "no edges for this PHID type" exception.
return
;
}
$editor
=
new
PhabricatorEdgeEditor
();
foreach
(
$edges
as
$type
=>
$type_edges
)
{
foreach
(
$type_edges
as
$src
=>
$src_edges
)
{
foreach
(
$src_edges
as
$dst
=>
$edge
)
{
$editor
->
removeEdge
(
$edge
[
'src'
],
$edge
[
'type'
],
$edge
[
'dst'
]);
}
}
}
$editor
->
save
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 30, 4:12 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
274683
Default Alt Text
PhabricatorEdgesDestructionEngineExtension.php (904 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment