Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
Show All 11 Lines | if (isset($map[$phid_type])) { | ||||
$object = $type->newObject(); | $object = $type->newObject(); | ||||
if ($object) { | if ($object) { | ||||
return $object->establishConnection($conn_type); | return $object->establishConnection($conn_type); | ||||
} | } | ||||
} | } | ||||
static $class_map = array( | static $class_map = array( | ||||
PhabricatorPHIDConstants::PHID_TYPE_TOBJ => 'HarbormasterObject', | PhabricatorPHIDConstants::PHID_TYPE_TOBJ => 'HarbormasterObject', | ||||
PhabricatorPHIDConstants::PHID_TYPE_XOBJ => 'DoorkeeperExternalObject', | |||||
); | ); | ||||
$class = idx($class_map, $phid_type); | $class = idx($class_map, $phid_type); | ||||
if (!$class) { | if (!$class) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
"Edges are not available for objects of type '%s'!", | "Edges are not available for objects of type '%s'!", | ||||
$phid_type)); | $phid_type)); | ||||
} | } | ||||
return newv($class, array())->establishConnection($conn_type); | return newv($class, array())->establishConnection($conn_type); | ||||
} | } | ||||
} | } |