Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120572109
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
Sat, Jul 5, 07:58
Size
858 B
Mime Type
text/x-php
Expires
Mon, Jul 7, 07:58 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27208346
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