Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92424747
PhabricatorEdgeConfig.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, Nov 20, 04:48
Size
858 B
Mime Type
text/x-php
Expires
Fri, Nov 22, 04:48 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22439596
Attached To
rPH Phabricator
PhabricatorEdgeConfig.php
View Options
<?php
final
class
PhabricatorEdgeConfig
extends
PhabricatorEdgeConstants
{
const
TABLE_NAME_EDGE
=
'edge'
;
const
TABLE_NAME_EDGEDATA
=
'edgedata'
;
public
static
function
establishConnection
(
$phid_type
,
$conn_type
)
{
$map
=
PhabricatorPHIDType
::
getAllTypes
();
if
(
isset
(
$map
[
$phid_type
]))
{
$type
=
$map
[
$phid_type
];
$object
=
$type
->
newObject
();
if
(
$object
)
{
return
$object
->
establishConnection
(
$conn_type
);
}
}
static
$class_map
=
array
(
PhabricatorPHIDConstants
::
PHID_TYPE_TOBJ
=>
'HarbormasterObject'
,
);
$class
=
idx
(
$class_map
,
$phid_type
);
if
(!
$class
)
{
throw
new
Exception
(
pht
(
"Edges are not available for objects of type '%s'!"
,
$phid_type
));
}
return
newv
(
$class
,
array
())->
establishConnection
(
$conn_type
);
}
}
Event Timeline
Log In to Comment