Path: blob/master/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
12242 views
<?php12final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants {34const TABLE_NAME_EDGE = 'edge';5const TABLE_NAME_EDGEDATA = 'edgedata';67public static function establishConnection($phid_type, $conn_type) {8$map = PhabricatorPHIDType::getAllTypes();9if (isset($map[$phid_type])) {10$type = $map[$phid_type];11$object = $type->newObject();12if ($object) {13return $object->establishConnection($conn_type);14}15}1617static $class_map = array(18PhabricatorPHIDConstants::PHID_TYPE_TOBJ => 'HarbormasterObject',19);2021$class = idx($class_map, $phid_type);2223if (!$class) {24throw new Exception(25pht(26"Edges are not available for objects of type '%s'!",27$phid_type));28}2930return newv($class, array())->establishConnection($conn_type);31}3233}343536