Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F115411727
PhabricatorEdgesDestructionEngineExtension.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, May 31, 20:01
Size
904 B
Mime Type
text/x-php
Expires
Mon, Jun 2, 20:01 (2 d)
Engine
blob
Format
Raw Data
Handle
26506416
Attached To
rPH Phabricator
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
();
}
}
Event Timeline
Log In to Comment